UNPKG

nestablejs

Version:

NestableJS is a javascript library for creating drag & drop heirarchical lists.

18 lines (15 loc) 508 B
const items = document.getElementById('items'); const SELECTABLE = new Selectable({ filter: ".item", appendTo: items, ignore: ".handle" // ignore the handle used for sorting }); const SORTABLE = Sortable.create(items, { animation: 200, handle: ".handle", onUpdate: function (evt) { // Selecting will still work, but shift + select will be broken due to the order difference. // So update the Selctable instance to reflect the new order. SELECTABLE.update(); } });