mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
Fixes dragging devices out of the inventory toolbox
Fixes a defect where devices were dropped onto the canvas if they were moved a small amount after being selected in the inventory toolbox. This fix checks that the mouse has cleared the boundary of the inventory toolbox before dropping it onto the canvas.
This commit is contained in:
parent
7781667977
commit
10fd65bea0
@ -234,8 +234,19 @@ _Start.prototype.start.transitions = ['Ready'];
|
||||
|
||||
_Move.prototype.onMouseUp = function (controller) {
|
||||
|
||||
controller.changeState(Dropping);
|
||||
var i = 0;
|
||||
var toolbox = controller.toolbox;
|
||||
|
||||
if (controller.scope.mouseX < controller.toolbox.width) {
|
||||
for(i = 0; i < toolbox.items.length; i++) {
|
||||
toolbox.items[i].selected = false;
|
||||
}
|
||||
toolbox.selected_item = null;
|
||||
controller.changeState(Ready);
|
||||
|
||||
} else {
|
||||
controller.changeState(Dropping);
|
||||
}
|
||||
};
|
||||
_Move.prototype.onMouseUp.transitions = ['Dropping'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user