Skip to content

Commit

Permalink
dismiss HTML5 drag events with jQuery dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Jun 24, 2015
1 parent ae577f4 commit 9553bd0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

+ Fixed bug with HTML5 drag & drop. Fixed [#206](https://github.com/metafizzy/packery/issues/206)

### v1.4.1

+ Remove `instance` argument from `dragItemPositioned` and `fitComplete` events
Expand Down
14 changes: 12 additions & 2 deletions js/packery.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,23 @@ Packery.prototype._create = function() {
};

this.handleUIDraggable = {
start: function handleUIDraggableStart( event ) {
start: function handleUIDraggableStart( event, ui ) {
// HTML5 may trigger dragstart, dismiss HTML5 dragging
if ( !ui ) {
return;
}
_this.itemDragStart( event.currentTarget );
},
drag: function handleUIDraggableDrag( event, ui ) {
if ( !ui ) {
return;
}
_this.itemDragMove( event.currentTarget, ui.position.left, ui.position.top );
},
stop: function handleUIDraggableStop( event ) {
stop: function handleUIDraggableStop( event, ui ) {
if ( !ui ) {
return;
}
_this.itemDragEnd( event.currentTarget );
}
};
Expand Down

0 comments on commit 9553bd0

Please sign in to comment.