From 87e336a175ec4d0e593df685fe1f9ced612395fd Mon Sep 17 00:00:00 2001 From: RubaXa Date: Mon, 16 Feb 2015 08:57:02 +0300 Subject: [PATCH] #277: * fixed handle & filter --- Sortable.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Sortable.js b/Sortable.js index fbd588a..2b6f6fc 100644 --- a/Sortable.js +++ b/Sortable.js @@ -275,12 +275,12 @@ return; // only left button or enabled } - if (options.handle) { - target = _closest(target, options.handle, el); - } - target = _closest(target, options.draggable, el); + if (!target) { + return; + } + // get the index of the dragged element within its parent oldIndex = _index(target); @@ -308,6 +308,12 @@ } } + + if (options.handle && !_closest(originalTarget, options.handle, el)) { + return; + } + + // Prepare `dragstart` if (target && !dragEl && (target.parentNode === el)) { tapEvt = evt;