Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 7cfe571

Browse files
committed
2 parents 9db6116 + c4b8e1b commit 7cfe571

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/sortable.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@ angular.module('ui.sortable', [])
115115
// the start and stop of repeat sections and sortable doesn't
116116
// respect their order (even if we cancel, the order of the
117117
// comments are still messed up).
118-
savedNodes.detach();
119118
if (element.sortable('option','helper') === 'clone') {
120-
// first detach all the savedNodes and then restore all of them
121-
// except .ui-sortable-helper element (which is placed last).
122-
// That way it will be garbage collected.
119+
// restore all the savedNodes except .ui-sortable-helper element
120+
// (which is placed last). That way it will be garbage collected.
123121
savedNodes = savedNodes.not(savedNodes.last());
124122
}
125123
savedNodes.appendTo(element);
@@ -153,7 +151,7 @@ angular.module('ui.sortable', [])
153151
// if the item was not moved, then restore the elements
154152
// so that the ngRepeat's comment are correct.
155153
if((!('dropindex' in ui.item.sortable) || ui.item.sortable.isCanceled()) && element.sortable('option','helper') !== 'clone') {
156-
savedNodes.detach().appendTo(element);
154+
savedNodes.appendTo(element);
157155
}
158156
}
159157
};

0 commit comments

Comments
 (0)