-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix merge conflict, conflict in minified version of build output
- Loading branch information
Showing
12 changed files
with
172 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
describe("ko.bindingHandlers.kendoSortable", function(){ | ||
//standard cases | ||
ko.kendo.generateBindingSpecs("kendoSortable", { | ||
html: "<div></div>" | ||
}); | ||
|
||
//additional kendoSortable cases | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
createBinding({ | ||
name: "kendoSortable", | ||
defaultOption: DATA, | ||
events: { | ||
end: function(options, e) { | ||
var dataKey = "__ko_kendo_sortable_data__", | ||
data = e.action !== "receive" ? ko.dataFor(e.item[0]) : e.draggableEvent[dataKey], | ||
items = options.data, | ||
underlyingArray = options.data; | ||
|
||
//remove item from its original position | ||
if (e.action === "sort" || e.action === "remove") { | ||
underlyingArray.splice(e.oldIndex, 1); | ||
|
||
//keep track of the item between remove and receive | ||
if (e.action === "remove") { | ||
e.draggableEvent[dataKey] = data; | ||
} | ||
} | ||
|
||
//add the item to its new position | ||
if (e.action === "sort" || e.action === "receive") { | ||
underlyingArray.splice(e.newIndex, 0, data); | ||
|
||
//clear the data we passed | ||
delete e.draggableEvent[dataKey]; | ||
|
||
//we are moving the item ourselves via the observableArray, cancel the draggable and hide the animation | ||
$(e.draggableEvent.target).hide(); | ||
e.preventDefault(); | ||
} | ||
|
||
//signal that the observableArray has changed now that we are done changing the array | ||
items.valueHasMutated(); | ||
} | ||
} | ||
}); |