draggable: direct removal of draggable element on drop event doesnt make used plugins fire an error anymore, fixes #4550

This commit is contained in:
Paul Bakaus 2009-08-21 14:13:47 +00:00
parent 5293096526
commit 374f2cbb55

View File

@ -158,6 +158,10 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
this.dropped = false;
}
//if the original element is removed, don't bother to continue
if(!this.element[0] || !this.element[0].parentNode)
return false;
if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
var self = this;
$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {