From f58999fca796febffd3bf33e4739be4a6db699a6 Mon Sep 17 00:00:00 2001 From: Kristen Cooke Date: Wed, 27 Jan 2016 00:47:56 -0800 Subject: [PATCH] replace Object.assign to regain IE support --- Sortable.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Sortable.html b/Sortable.html index a8c1967..77994ce 100644 --- a/Sortable.html +++ b/Sortable.html @@ -61,9 +61,9 @@ var options = {} Object.keys(this.properties).forEach(function(key) { options[key] = this[key] - }) + }); - this.sortable = Sortable.create(this, Object.assign(options, { + var eventCallbacks = { onUpdate: function (e) { if (template) { template.splice("items", e.newIndex, 0, template.splice("items", e.oldIndex, 1)[0]) @@ -115,7 +115,13 @@ onClone: function(e) { this.fire("clone", e) } - })) + }; + + Object.keys(eventCallbacks).forEach(function(name){ + options[name] = eventCallbacks[name]; + }); + + this.sortable = Sortable.create(this, options); }, detached: function() {