Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 70653ab

Browse files
committed
Merge branch 'master' of https://github.com/mapmf/ui-sortable into mapmf-master
2 parents 7ebaa33 + c387ba5 commit 70653ab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sortable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ angular.module('ui.sortable', [])
345345
// Save current drop position but only if this is not a second
346346
// update that happens when moving between lists because then
347347
// the value will be overwritten with the old value
348+
349+
var wasMoved = ('dropindex' in ui.item.sortable) &&
350+
!ui.item.sortable.isCanceled();
351+
348352
if(!ui.item.sortable.received) {
349353
ui.item.sortable.dropindex = getItemIndex(ui.item);
350354
var droptarget = ui.item.closest('[ui-sortable], [data-ui-sortable], [x-ui-sortable]');
@@ -393,6 +397,11 @@ angular.module('ui.sortable', [])
393397
ui.item.sortable.moved);
394398
});
395399
}
400+
401+
if(wasMoved && !ui.item.sortable.received){
402+
scope.$emit('sortable:wasMoved');
403+
}
404+
396405
};
397406

398407
callbacks.stop = function(e, ui) {

0 commit comments

Comments
 (0)