Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply dragged function also on update #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build/knockout-sortable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// knockout-sortable 0.9.3 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
// knockout-sortable 0.9.3 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
;(function(factory) {
if (typeof define === "function" && define.amd) {
// AMD anonymous module
Expand Down Expand Up @@ -187,6 +187,10 @@

dragItem = null;

if (sortable.dragged) {
item = sortable.dragged.call(this, item, event, ui) || item;
}

//make sure that moves only run once, as update fires on multiple containers
if (item && (this === parentEl) || (!hasNestedSortableFix && $.contains(this, parentEl))) {
//identify parents
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.

4 changes: 4 additions & 0 deletions src/knockout-sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@

dragItem = null;

if (sortable.dragged) {
item = sortable.dragged.call(this, item, event, ui) || item;
}

//make sure that moves only run once, as update fires on multiple containers
if (item && (this === parentEl) || (!hasNestedSortableFix && $.contains(this, parentEl))) {
//identify parents
Expand Down