Browse Source

#120: pull 'clone'

pull/126/merge
RubaXa 10 years ago
parent
commit
3f1cd3f155
  1. 8
      Sortable.js
  2. 2
      Sortable.min.js

8
Sortable.js

@ -247,10 +247,12 @@
_dispatchEvent(dragEl, 'start');
if (activeGroup.pull == 'clone') {
cloneEl = dragEl.cloneNode(true);
_css(cloneEl, 'display', 'none');
rootEl.insertBefore(cloneEl, dragEl);
}
}
},
_emulateDragOver: function (){
@ -375,13 +377,13 @@
target = _closest(evt.target, this.options.draggable, el);
dragRect = dragEl.getBoundingClientRect();
if ((activeGroup.pull == 'clone') && (cloneEl.state !== isOwner)) {
if (cloneEl && (cloneEl.state !== isOwner)) {
_css(cloneEl, 'display', isOwner ? 'none' : '');
!isOwner && cloneEl.state && rootEl.insertBefore(cloneEl, dragEl);
cloneEl.state = isOwner;
}
if (revert) {
if (revert && cloneEl) {
rootEl.insertBefore(dragEl, cloneEl);
return;
}
@ -504,7 +506,7 @@
_dispatchEvent(dragEl, 'update');
_dispatchEvent(dragEl, 'sort');
cloneEl.parentNode.removeChild(cloneEl);
cloneEl && cloneEl.parentNode.removeChild(cloneEl);
}
_dispatchEvent(rootEl, 'end');

2
Sortable.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save