Skip to content

Commit

Permalink
draggable: direct removal of draggable element on drop event doesnt m…
Browse files Browse the repository at this point in the history
…ake used plugins fire an error anymore, fixes #4550
  • Loading branch information
Paul Bakaus committed Aug 21, 2009
1 parent 5293096 commit 374f2cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/ui.draggable.js
Expand Up @@ -157,6 +157,10 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
dropped = this.dropped; dropped = this.dropped;
this.dropped = false; 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))) { 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; var self = this;
Expand Down

0 comments on commit 374f2cb

Please sign in to comment.