Browse Source

Merge pull request #744 from n00dl3/dev

trigger most specialized events first
pull/754/head
Lebedev Konstantin 9 years ago
parent
commit
3d3ad91a5b
  1. 7
      Sortable.js

7
Sortable.js

@ -824,15 +824,16 @@
newIndex = _index(dragEl, options.draggable); newIndex = _index(dragEl, options.draggable);
if (newIndex >= 0) { if (newIndex >= 0) {
// drag from one list and drop into another
_dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
// Add event // Add event
_dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex); _dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex);
// Remove event // Remove event
_dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex); _dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex);
// drag from one list and drop into another
_dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
} }
} }
else { else {

Loading…
Cancel
Save