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

Commit 6beb70c

Browse files
committed
docs: document the order that jQueryUI Sortable events trigger
1 parent 7d65377 commit 6beb70c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,49 @@ $scope.sortableOptions = {
8686
So `ui.item.scope` and the directive's `ng-model`, are equal to the scope before the drag start.
8787
* 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.
8888

89+
### jQueryUI Sortable Event order
90+
91+
**Single sortable** [demo](http://codepen.io/thgreasi/pen/KtsFH)
92+
```
93+
start
94+
activate
95+
96+
/* multiple: sort/change/over/out */
97+
98+
beforeStop
99+
update <= call cancel() here if needed
100+
deactivate
101+
stop
102+
```
103+
104+
**Connected sortables** [demo](http://codepen.io/thgreasi/pen/uIBKb)
105+
106+
```
107+
list A: start
108+
list B: activate
109+
list A: activate
110+
111+
/* both lists multiple: sort/change/over/out */
112+
list A: sort
113+
list A: change
114+
list B: change
115+
list B: over
116+
list A: sort
117+
list B: out
118+
list A: sort
119+
120+
list A: beforeStop
121+
list A: update <= call cancel() here if needed
122+
list A: remove
123+
list B: receive
124+
list B: update
125+
list B: deactivate
126+
list A: deactivate
127+
list A: stop
128+
```
129+
130+
For more details about the events check the [jQueryUI API documentation](http://api.jqueryui.com/sortable/).
131+
89132
## Examples
90133

91134
- [Simple Demo](http://codepen.io/thgreasi/pen/jlkhr)

0 commit comments

Comments
 (0)