From 06aac74871f3fd25a454df2fd7709ae5494e48ab Mon Sep 17 00:00:00 2001 From: RubaXa Date: Mon, 12 Jan 2015 18:56:35 +0300 Subject: [PATCH] #210: + 'dropBubble: false' & 'dragoverBubble: false' options --- Sortable.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sortable.js b/Sortable.js index b59986d..31386d3 100644 --- a/Sortable.js +++ b/Sortable.js @@ -106,7 +106,9 @@ animation: 0, setData: function (dataTransfer, dragEl) { dataTransfer.setData('Text', dragEl.textContent); - } + }, + dropBubble: false, + dragoverBubble: false }; @@ -465,7 +467,7 @@ if (evt.preventDefault !== void 0) { evt.preventDefault(); - evt.stopPropagation(); + !options.dragoverBubble && evt.stopPropagation(); } if (!_silent && activeGroup && @@ -586,7 +588,8 @@ }, _onDrop: function (/**Event*/evt) { - var el = this.el; + var el = this.el, + options = this.options; clearInterval(this._loopId); clearInterval(autoScroll.pid); @@ -601,7 +604,7 @@ if (evt) { evt.preventDefault(); - evt.stopPropagation(); + !options.dropBubble && evt.stopPropagation(); ghostEl && ghostEl.parentNode.removeChild(ghostEl);