Skip to content

Commit

Permalink
sortable: only remove placeholder if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
opsb committed Mar 21, 2014
1 parent 9fad37d commit cd5a4fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@ return $.widget("ui.sortable", $.ui.mouse, {
}

//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
var parentNode = this.placeholder[0].parentNode;
if(parentNode) parentNode.removeChild(this.placeholder[0]);

if(this.helper[0] !== this.currentItem[0]) {
this.helper.remove();
Expand Down

0 comments on commit cd5a4fa

Please sign in to comment.