Sha256: 4449e8f8b8a496c75ee5e82fe5a06e8733ab2ca5eeddd53e9a749555c2fd3127
Contents?: true
Size: 840 Bytes
Versions: 34
Compression:
Stored size: 840 Bytes
Contents
((exports) => { const { createSortList } = exports.DecidimAdmin; const createSortableList = (lists) => { createSortList(lists, { handle: "li", forcePlaceholderSize: true, connectWith: ".js-connect" }) }; // Once in DOM $(() => { const $draggables = $(".draggable-list") let draggablesClassNames = [] $draggables.each((index, elem) => { draggablesClassNames = [...draggablesClassNames, `.${elem.className.split(" ").filter((name) => (/js-list.*/).test(name))[0]}`] }) document.addEventListener("drag", function (event) { $draggables.not(event.target.parentElement).addClass("dragging") }) document.addEventListener("dragend", function() { $draggables.removeClass("dragging") }) createSortableList(draggablesClassNames.join(", ")) }) })(window)
Version data entries
34 entries across 34 versions & 1 rubygems