]> source.dussan.org Git - jquery-ui.git/commitdiff
Sortable - Prevent mouseCapture while help is reverting
authorEduardo Lundgren <eduardolundgren@gmail.com>
Tue, 28 Oct 2008 06:41:11 +0000 (06:41 +0000)
committerEduardo Lundgren <eduardolundgren@gmail.com>
Tue, 28 Oct 2008 06:41:11 +0000 (06:41 +0000)
ui/ui.sortable.js

index 52e8b65783fdb6ee576d25ba6ca88820e32e8c63..d1871c940cec1592b243af8ebb0bbb7dc50684ac 100644 (file)
@@ -384,6 +384,10 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
 
        _mouseCapture: function(e, overrideHandle) {
 
+               if (this.reverting) {
+                       return false;
+               }
+
                if(this.options.disabled || this.options.type == 'static') return false;
 
                //We have to refresh the items data once first
@@ -697,6 +701,8 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
                        var self = this;
                        var cur = self.placeholder.offset();
 
+                       self.reverting = true;
+
                        $(this.helper).animate({
                                left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
                                top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
@@ -713,6 +719,8 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
 
        _clear: function(e, noPropagation) {
 
+               this.reverting = false;
+
                //We first have to update the dom position of the actual currentItem
                if(!this._noFinalSort) this.placeholder.before(this.currentItem);
                this._noFinalSort = null;