Skip to content

Commit

Permalink
fixed small logical error with startDrag()
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdrowell committed Mar 25, 2013
1 parent 5192ccd commit dc107a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/DragAndDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
ap = this.getAbsolutePosition(),
animNode = layer || this;

if(pos && !dd.node) {
if(pos) {
if (dd.node) {
dd.node.stopDrag();
}

dd.node = this;
dd.offset.x = pos.x - ap.x;
dd.offset.y = pos.y - ap.y;
Expand Down
2 changes: 1 addition & 1 deletion src/Stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@
}

//init stage drag and drop
if(this.isDraggable()) {
if(this.isDraggable() && !dd.node) {
this.startDrag(evt);
}
},
Expand Down

0 comments on commit dc107a0

Please sign in to comment.