Browse Source

Add documentation for evt.to in onEnd

pull/1051/head
Joey Becker 8 years ago
parent
commit
56c696520c
  1. 19
      README.md

19
README.md

@ -121,32 +121,31 @@ var sortable = new Sortable(el, {
// Element dragging ended // Element dragging ended
onEnd: function (/**Event*/evt) { onEnd: function (/**Event*/evt) {
evt.oldIndex; // element's old index within parent var itemEl = evt.item; // dragged HTMLElement
evt.newIndex; // element's new index within parent evt.to; // target list
evt.from; // previous list
evt.oldIndex; // element's old index within old parent
evt.newIndex; // element's new index within new parent
}, },
// Element is dropped into the list from another list // Element is dropped into the list from another list
onAdd: function (/**Event*/evt) { onAdd: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement // same properties as onEnd
evt.to; // target list
evt.from; // previous list
// + indexes from onEnd
}, },
// Changed sorting within list // Changed sorting within list
onUpdate: function (/**Event*/evt) { onUpdate: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement // same properties as onEnd
// + indexes from onEnd
}, },
// Called by any change to the list (add / update / remove) // Called by any change to the list (add / update / remove)
onSort: function (/**Event*/evt) { onSort: function (/**Event*/evt) {
// same properties as onAdd // same properties as onEnd
}, },
// Element is removed from the list into another list // Element is removed from the list into another list
onRemove: function (/**Event*/evt) { onRemove: function (/**Event*/evt) {
// same properties as onAdd // same properties as onEnd
}, },
// Attempt to drag a filtered element // Attempt to drag a filtered element

Loading…
Cancel
Save