Skip to content

Commit 56c6965

Browse files
committed
Add documentation for evt.to in onEnd
1 parent bb37f20 commit 56c6965

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,32 +121,31 @@ var sortable = new Sortable(el, {
121121

122122
// Element dragging ended
123123
onEnd: function (/**Event*/evt) {
124-
evt.oldIndex; // element's old index within parent
125-
evt.newIndex; // element's new index within parent
124+
var itemEl = evt.item; // dragged HTMLElement
125+
evt.to; // target list
126+
evt.from; // previous list
127+
evt.oldIndex; // element's old index within old parent
128+
evt.newIndex; // element's new index within new parent
126129
},
127130

128131
// Element is dropped into the list from another list
129132
onAdd: function (/**Event*/evt) {
130-
var itemEl = evt.item; // dragged HTMLElement
131-
evt.to; // target list
132-
evt.from; // previous list
133-
// + indexes from onEnd
133+
// same properties as onEnd
134134
},
135135

136136
// Changed sorting within list
137137
onUpdate: function (/**Event*/evt) {
138-
var itemEl = evt.item; // dragged HTMLElement
139-
// + indexes from onEnd
138+
// same properties as onEnd
140139
},
141140

142141
// Called by any change to the list (add / update / remove)
143142
onSort: function (/**Event*/evt) {
144-
// same properties as onAdd
143+
// same properties as onEnd
145144
},
146145

147146
// Element is removed from the list into another list
148147
onRemove: function (/**Event*/evt) {
149-
// same properties as onAdd
148+
// same properties as onEnd
150149
},
151150

152151
// Attempt to drag a filtered element

0 commit comments

Comments
 (0)