diff --git a/bower.json b/bower.json index c934c0e..742b3ff 100644 --- a/bower.json +++ b/bower.json @@ -1,10 +1,10 @@ { "name": "Sortable", "main": [ - "Sortable.js", - "ng-sortable.js", - "knockout-sortable.js", - "react-sortable-mixin.js" + "Sortable.js", + "ng-sortable.js", + "knockout-sortable.js", + "react-sortable-mixin.js" ], "homepage": "http://rubaxa.github.io/Sortable/", "authors": [ @@ -20,7 +20,7 @@ "and", "drop", "dnd", - "web-components" + "web-components" ], "license": "MIT", "ignore": [ @@ -28,8 +28,5 @@ "bower_components", "test", "tests" - ], - "dependencies": { - "polymer": "Polymer/polymer#~1.1.4", - } + ] } diff --git a/knockout-sortable.js b/knockout-sortable.js index fcf7d66..dac7f6f 100644 --- a/knockout-sortable.js +++ b/knockout-sortable.js @@ -2,32 +2,34 @@ "use strict"; if (typeof define === "function" && define.amd) { // AMD anonymous module - define(["knockout"], factory); + define(["knockout", "./Sortable"], factory); } else if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { // CommonJS module var ko = require("knockout"); - factory(ko); + var Sortable = require('./Sortable'); + factory(ko, Sortable); } else { // No module loader (plain + + + + + diff --git a/package.json b/package.json index a13735f..3d30f68 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sortablejs", "exportName": "Sortable", - "version": "1.4.0", + "version": "1.4.2", "devDependencies": { "grunt": "*", "grunt-version": "*", diff --git a/react-sortable-mixin.js b/react-sortable-mixin.js index 2a8858a..7cab359 100644 --- a/react-sortable-mixin.js +++ b/react-sortable-mixin.js @@ -70,7 +70,7 @@ * @mixin */ var SortableMixin = { - sortableMixinVersion: '0.1.0', + sortableMixinVersion: '0.1.1', /** @@ -120,7 +120,13 @@ } newState[_getModelName(this)] = items; - this.setState(newState); + + if (copyOptions.stateHandler) { + this[copyOptions.stateHandler](newState); + } else { + this.setState(newState); + } + (this !== _activeComponent) && _activeComponent.setState(remoteState); }