diff --git a/.gitignore b/.gitignore index 631cb6f..c3d1572 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -node_modules/ -reports/ \ No newline at end of file +node_modules/ +reports/ +/.vs + diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..a41b834 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/examples/deferred.html b/examples/deferred.html new file mode 100644 index 0000000..72c7b8b --- /dev/null +++ b/examples/deferred.html @@ -0,0 +1,149 @@ + + + + + Draggable, droppable, and sortable list (2.0) + + + + + + + + + + +
+

Tasks

+
+ +
+ + + + + + +
+ +
+ Add Task +
+ +
+

Tasks

+ +
+ + + + diff --git a/src/knockout-sortable.js b/src/knockout-sortable.js index 79e9cd2..67b246e 100644 --- a/src/knockout-sortable.js +++ b/src/knockout-sortable.js @@ -1,4 +1,4 @@ -;(function(factory) { +;(function(factory) { if (typeof define === "function" && define.amd) { // AMD anonymous module define(["knockout", "jquery", "jquery-ui/ui/widgets/sortable", "jquery-ui/ui/widgets/draggable", "jquery-ui/ui/widgets/droppable"], factory); @@ -273,7 +273,11 @@ } //if using deferred updates on knockout 3.4, force updates - if (ko.options && ko.options.deferUpdates) { + //if ((ko.options && ko.options.deferUpdates) || (sourceParent && sourceParent._deferUpdates)) { + // ko.tasks.runEarly(); + //} + + if (typeof ko.tasks.runEarly === "function") { ko.tasks.runEarly(); } }