From 0dc1c1b91fbc45ead29eeb494861b52e1e113639 Mon Sep 17 00:00:00 2001 From: n00dl3 Date: Wed, 20 Jan 2016 11:35:57 +0100 Subject: [PATCH] trigger most specialized events first --- Sortable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sortable.js b/Sortable.js index 6a025ea..6a8e2d5 100644 --- a/Sortable.js +++ b/Sortable.js @@ -824,15 +824,15 @@ newIndex = _index(dragEl, options.draggable); 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 _dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex); // Remove event _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 {