Conversation
Test FAILed. |
container.delegate('drop', this._unitDropHandler, spec, this); | ||
container.delegate('dragenter', this._ignore, spec, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By removing this you will break drop events because the dragenter event needs to be prevented to allow the drop events to fire. See https://developer.mozilla.org/en-US/docs/DragDrop/Drag_Operations#droptargets
Test FAILed. |
Test PASSed. |
Test FAILed. |
@@ -45,9 +45,10 @@ YUI.add('mv-drop-target-view-extension', function(Y) { | |||
_attachDragEvents: function(spec) { | |||
var container = this.get('container'); | |||
// .token is the container of the machine/container token | |||
spec = spec || '.token'; | |||
spec = spec || '.drop'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The machine-panel-view-header.js called this method passing in the spec as '.drop'. Since it's now the default just for a little cleanup that method no longer needs to pass it in.
Thanks for this, it's coming together nicely! |
Test FAILed. |
Test FAILed. |
The last commit fixes dropping a unit on a token, but as part of that I needed to move the event attaching out of the render as they were being attached multiple times. Before I fix all the tests I wanted to check why it was being done that way in the first place and if this is an OK solution? |
Test PASSed. |
Enough has changed in this branch that it could probably do with another review. |
QA:
|
this._machinesHeader.setDroppable(); | ||
// We only show that the container header is droppable if the user | ||
// has selected a machine as a parent already. | ||
if (this.get('selectedMachine')) { | ||
this._containersHeader.setDroppable(); | ||
} | ||
// Show the drop states for all visible machines and containers. | ||
Object.keys(machineTokens).forEach(function(id) { | ||
var token = machineTokens[id]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redefining a var every loop
machineTokens[id].setDroppable()
;
(The same is done 4 times)
👍 Again :) |
Build failed: Attempt to land pull request failed |
Status: merge request accepted. Url: http://ci.jujugui.org:8080/job/juju-gui-merge |
Added new drag hover and drop states. Added new drop states and highlighting when tokens are dragged over drop targets. QA: - drag two charms to the canvas - open the machine view - start dragging one of the units - the 'Create new machine' should appear in the header with new styling - hover the unit over the drop area - the background should go grey - drop the unit on the header and click create in the constraints form - click on the 'new0' machine - start dragging the second unit - the 'Create new machine' and 'Create new container' headers' targets should appear - the machine and container tokens should show the 'Add to machine new0' and 'Add to container Bare metal' respectively - hovering the unit over the headers and tokens should turn them grey - dropping the unit on a header or token should make the drop areas disappear
Added new drop states and highlighting when tokens are dragged over drop targets.
QA: