Skip to content

Commit

Permalink
[BUG] Fix cancel revert with copy and copySortSource
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilBroadbent committed Oct 26, 2017
1 parent 7b9d90e commit fa2e327
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,13 @@ function dragula (initialContainers, options) {
var initial = isInitialPlacement(parent);
if (initial === false && reverts) {
if (_copy) {
if (parent) {
parent.removeChild(_copy);
}
if (parent) {
if (parent !== _source) {
parent.removeChild(_copy);
} else {
_source.insertBefore(item, _initialSibling);
}
}
} else {
_source.insertBefore(item, _initialSibling);
}
Expand Down

0 comments on commit fa2e327

Please sign in to comment.