From 56c696520c6123a8bdaa5a06ae50b35072fe711c Mon Sep 17 00:00:00 2001 From: Joey Becker Date: Fri, 2 Jun 2017 10:40:01 -0500 Subject: [PATCH] Add documentation for evt.to in onEnd --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f7a390c..e1fae50 100644 --- a/README.md +++ b/README.md @@ -121,32 +121,31 @@ var sortable = new Sortable(el, { // Element dragging ended onEnd: function (/**Event*/evt) { - evt.oldIndex; // element's old index within parent - evt.newIndex; // element's new index within parent + var itemEl = evt.item; // dragged HTMLElement + 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 onAdd: function (/**Event*/evt) { - var itemEl = evt.item; // dragged HTMLElement - evt.to; // target list - evt.from; // previous list - // + indexes from onEnd + // same properties as onEnd }, // Changed sorting within list onUpdate: function (/**Event*/evt) { - var itemEl = evt.item; // dragged HTMLElement - // + indexes from onEnd + // same properties as onEnd }, // Called by any change to the list (add / update / remove) onSort: function (/**Event*/evt) { - // same properties as onAdd + // same properties as onEnd }, // Element is removed from the list into another list onRemove: function (/**Event*/evt) { - // same properties as onAdd + // same properties as onEnd }, // Attempt to drag a filtered element