From cddc0217724f1a7661014d50e4c940e623a0c2dc Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 3 Aug 2021 07:12:35 +0000 Subject: Apps drag and drop feature --- library/Sortable/plugins/OnSpill/README.md | 60 ++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 library/Sortable/plugins/OnSpill/README.md (limited to 'library/Sortable/plugins/OnSpill/README.md') diff --git a/library/Sortable/plugins/OnSpill/README.md b/library/Sortable/plugins/OnSpill/README.md new file mode 100644 index 000000000..816fd19cc --- /dev/null +++ b/library/Sortable/plugins/OnSpill/README.md @@ -0,0 +1,60 @@ +# OnSpill Plugins +This file contains two seperate plugins, RemoveOnSpill and RevertOnSpill. They can be imported individually, or the default export (an array of both plugins) can be passed to `Sortable.mount` as well. + +**These plugins are default plugins, and are included in the default UMD and ESM builds of Sortable** + + +--- + + +### Mounting +```js +import { Sortable, OnSpill } from 'sortablejs/modular/sortable.core.esm'; + +Sortable.mount(OnSpill); +``` + + +--- + + +## RevertOnSpill Plugin +This plugin, when enabled, will cause the dragged item to be reverted to it's original position if it is spilled (ie. it is dropped outside of a valid Sortable drop target) + + + + +### Options + +```js +new Sortable(el, { + revertOnSpill: true, // Enable plugin + // Called when item is spilled + onSpill: function(/**Event*/evt) { + evt.item // The spilled item + } +}); +``` + + +--- + + +## RemoveOnSpill Plugin +This plugin, when enabled, will cause the dragged item to be removed from the DOM if it is spilled (ie. it is dropped outside of a valid Sortable drop target) + + +--- + + +### Options + +```js +new Sortable(el, { + removeOnSpill: true, // Enable plugin + // Called when item is spilled + onSpill: function(/**Event*/evt) { + evt.item // The spilled item + } +}); +``` -- cgit v1.2.3