From 6e084fd8353f3d3279487e79ed11d9447f74c38e Mon Sep 17 00:00:00 2001 From: Lebedev Konstantin Date: Fri, 17 Feb 2017 00:00:04 +0300 Subject: [PATCH] #1037: fixed dynamic checkPull behavior --- Sortable.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Sortable.js b/Sortable.js index 6fe0b2e..8eb1fdb 100644 --- a/Sortable.js +++ b/Sortable.js @@ -623,7 +623,7 @@ this._offUpEvents(); - if (activeGroup.checkPull(this, this, dragEl, evt) == 'clone') { + if (activeGroup.checkPull(this, this, dragEl, evt)) { cloneEl = _clone(dragEl); cloneEl.draggable = false; @@ -689,7 +689,10 @@ ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list : ( putSortable === this || - activeGroup.checkPull(this, activeSortable, dragEl, evt) && group.checkPut(this, activeSortable, dragEl, evt) + ( + (activeSortable.lastPullMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && + group.checkPut(this, activeSortable, dragEl, evt) + ) ) ) && (evt.rootEl === void 0 || evt.rootEl === this.el) // touch fallback @@ -1096,6 +1099,10 @@ function _cloneHide(sortable, state) { + if (sortable.lastPullMode !== 'clone') { + state = true; + } + if (cloneEl && (cloneEl.state !== state)) { _css(cloneEl, 'display', state ? 'none' : '');