Skip to content

Commit

Permalink
Sortable: Skip triggering over event if it's alreay over the continer…
Browse files Browse the repository at this point in the history
…. Fixes #9041: the over event fires on every pixel movement
  • Loading branch information
zhizhangchen authored and mikesherov committed Mar 8, 2013
1 parent 89473f6 commit 07ce771
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/jquery.ui.sortable.js
Expand Up @@ -842,8 +842,10 @@ $.widget("ui.sortable", $.ui.mouse, {

// move the item into the container if it's not there already
if(this.containers.length === 1) {
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
this.containers[innermostIndex].containerCache.over = 1;
if (!this.containers[innermostIndex].containerCache.over) {
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
this.containers[innermostIndex].containerCache.over = 1;
}
} else {

//When entering a new container, we will find the item with the least distance and append our item near it
Expand Down

0 comments on commit 07ce771

Please sign in to comment.