Skip to content
Permalink
Browse files

sortable:fixed #3019, stop being fird too early

  • Loading branch information
Paul Bakaus
Paul Bakaus committed Jun 24, 2008
1 parent dd584fb commit a002680ba96639f0a6c959f25048c3ebac043a10
Showing with 19 additions and 4 deletions.
  1. +12 −0 tests/sortable.js
  2. +7 −4 ui/ui.sortable.js
@@ -122,5 +122,17 @@ test("defaults", function() {

});

test("#3019: Stop fires too early", function() {

var helper = null;
el = $("#sortable").sortable({ stop: function(e, ui) {
helper = ui.helper;
}});

sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable');
equals(helper, null, "helper should be false");

});


})(jQuery);
@@ -519,11 +519,9 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
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)
}, parseInt(this.options.revert, 10) || 500, function() {
self.propagate("stop", e, null, noPropagation);
self.clear(e);
});
} else {
this.propagate("stop", e, null, noPropagation);
this.clear(e, noPropagation);
}

@@ -554,10 +552,15 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
}

this.dragging = false;
if(this.cancelHelperRemoval) return false;
if(this.cancelHelperRemoval) {
this.propagate("stop", e, null, noPropagation);
return false;
}

$(this.currentItem).css('visibility', '');
if(this.placeholder) this.placeholder.remove();
this.helper.remove();
this.helper.remove(); this.helper = null;
this.propagate("stop", e, null, noPropagation);

return true;

0 comments on commit a002680

Please sign in to comment.
You can’t perform that action at this time.