Skip to content

Commit

Permalink
Rebuild files
Browse files Browse the repository at this point in the history
Rebuild distributable files
  • Loading branch information
JD-Robbs committed Mar 31, 2016
1 parent f9b2c7d commit 6ee94f7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 21 deletions.
87 changes: 68 additions & 19 deletions build/knockout-sortable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// knockout-sortable 0.12.0 | (c) 2016 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
// knockout-sortable 0.13.0 | (c) 2016 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
;(function(factory) {
if (typeof define === "function" && define.amd) {
// AMD anonymous module
Expand Down Expand Up @@ -247,24 +247,73 @@
if (arg && arg.cancelDrop) {
return;
}

//do the actual move
if (targetIndex >= 0) {
if (sourceParent) {
sourceParent.splice(sourceIndex, 1);

//if using deferred updates plugin, force updates
if (ko.processAllDeferredBindingUpdates) {
ko.processAllDeferredBindingUpdates();
}
}

targetParent.splice(targetIndex, 0, item);
}

//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);


//if the strategy option is unset or false, employ the order strategy involving removal and insertion of items
if(!sortable.hasOwnProperty("strategyMove") || sortable.strategyMove === false)
{
//do the actual move
if (targetIndex >= 0) {
if (sourceParent) {
sourceParent.splice(sourceIndex, 1);

//if using deferred updates plugin, force updates
if (ko.processAllDeferredBindingUpdates) {
ko.processAllDeferredBindingUpdates();
}
}

targetParent.splice(targetIndex, 0, item);
}

//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);
}
else { //employ the strategy of moving items
if (targetIndex >= 0) {
if (sourceParent) {
if (sourceParent !== targetParent) {
// moving from one list to another

sourceParent.splice(sourceIndex, 1);

//if using deferred updates plugin, force updates
if (ko.processAllDeferredBindingUpdates) {
ko.processAllDeferredBindingUpdates();
}

targetParent.splice(targetIndex, 0, item);

//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);
ui.item.remove();
}
else {
// moving within same list
var underlyingList = unwrap(sourceParent);

// notify 'beforeChange' subscribers
sourceParent.valueWillMutate();

// move from source index ...
underlyingList.splice(sourceIndex, 1);
// ... to target index
underlyingList.splice(targetIndex, 0, item);

// notify subscribers
sourceParent.valueHasMutated();
}
}
else {
// drop new element from outside
targetParent.splice(targetIndex, 0, item);

//rendering is handled by manipulating the observableArray; ignore dropped element
dataSet(el, ITEMKEY, null);
ui.item.remove();
}
}
}

//if using deferred updates plugin, force updates
if (ko.processAllDeferredBindingUpdates) {
ko.processAllDeferredBindingUpdates();
Expand Down
4 changes: 2 additions & 2 deletions build/knockout-sortable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ee94f7

Please sign in to comment.