From 468633772e644df7cfdf305672b36a6e0cb2a4d1 Mon Sep 17 00:00:00 2001 From: why520crazy Date: Wed, 20 Jan 2016 16:37:30 +0800 Subject: [PATCH] fix bug for https://github.com/RubaXa/Sortable/issues/628 --- Sortable.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Sortable.js b/Sortable.js index d271999e8..281b02544 100644 --- a/Sortable.js +++ b/Sortable.js @@ -23,11 +23,11 @@ } })(function () { "use strict"; - + if (typeof window == "undefined" || typeof window.document == "undefined") { - return function() { - throw new Error( "Sortable.js requires a window with a document" ); - } + return function () { + throw new Error("Sortable.js requires a window with a document"); + }; } var dragEl, @@ -334,8 +334,11 @@ // we can re-enable the events: touchmove/mousemove _this._disableDelayedDrag(); - // Make the element draggable - dragEl.draggable = true; + // fix bug for https://github.com/RubaXa/Sortable/issues/628 + if (_this.nativeDraggable) { + // Make the element draggable + dragEl.draggable = true; + } // Chosen item _toggleClass(dragEl, _this.options.chosenClass, true); @@ -818,7 +821,7 @@ this._nulling(); }, - _nulling: function() { + _nulling: function () { // Nulling rootEl = dragEl =