You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,19 @@ $scope.sortableOptions = {
142
142
**Notes:**
143
143
*`update` is the appropriate place to cancel a sorting, since it occurs before any model/scope changes but after the DOM position has been updated.
144
144
So `ui.item.scope` and the directive's `ng-model`, are equal to the scope before the drag start.
145
-
* To [cancel a sorting between connected lists](https://github.com/angular-ui/ui-sortable/issues/107#issuecomment-33633638), `cancel` should be called inside the `update` callback of the originating list.
145
+
* To [cancel a sorting between connected lists](https://github.com/angular-ui/ui-sortable/issues/107#issuecomment-33633638), `cancel` should be called inside the `update` callback of the originating list. A simple way to is to use the `ui.item.sortable.received` property:
146
+
```js
147
+
update:function(event, ui) {
148
+
if (// ensure we are in the first update() callback
149
+
!ui.item.sortable.received&&
150
+
// check that its an actual moving between the two lists
0 commit comments