diff --git a/dist/html.sortable.js b/dist/html.sortable.js
index a0218660..164b6eaa 100644
--- a/dist/html.sortable.js
+++ b/dist/html.sortable.js
@@ -466,6 +466,11 @@ var _getChildren = function (element) {
return element.children
}
+var _serialize = function (list) {
+ var children = _filter(_getChildren(list), _data(list, 'items'))
+ return children
+}
+
/*
* Public sortable object
* @param {Array|NodeList} sortableElements
@@ -505,12 +510,22 @@ var sortable = function (sortableElements, options) {
sortableElements = Array.prototype.slice.call(sortableElements)
+ if (/serialize/.test(method)) {
+ var serialized = []
+ sortableElements.forEach(function (sortableElement) {
+ serialized.push({
+ list: sortableElement,
+ children: _serialize(sortableElement)
+ })
+ })
+ return serialized
+ }
+
/* TODO: maxstatements should be 25, fix and remove line below */
/* jshint maxstatements:false */
sortableElements.forEach(function (sortableElement) {
if (/enable|disable|destroy/.test(method)) {
- sortable[method](sortableElement)
- return
+ return sortable[method](sortableElement)
}
// get options & set options on sortable
@@ -522,6 +537,7 @@ var sortable = function (sortableElements, options) {
var items = _filter(_getChildren(sortableElement), options.items)
var index
var startParent
+ var startList
var placeholder = options.placeholder
var maxItems
if (!placeholder) {
@@ -590,6 +606,7 @@ var sortable = function (sortableElements, options) {
index = _index(dragging)
draggingHeight = parseInt(window.getComputedStyle(dragging).height)
startParent = this.parentElement
+ startList = _serialize(startParent)
// dispatch sortstart event on each element in group
_dispatchEventOnConnected(sortableElement, _makeEvent('sortstart', {
item: dragging,
@@ -624,7 +641,10 @@ var sortable = function (sortableElements, options) {
elementIndex: _index(dragging),
oldElementIndex: index,
startparent: startParent,
- endparent: newParent
+ endparent: newParent,
+ newEndList: _serialize(newParent),
+ newStartList: _serialize(startParent),
+ oldStartList: startList
}))
}
dragging = null
diff --git a/dist/html.sortable.min.js b/dist/html.sortable.min.js
index a95ccb51..89e98925 100644
--- a/dist/html.sortable.min.js
+++ b/dist/html.sortable.min.js
@@ -1,2 +1,2 @@
-!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.sortable=t()}(this,function(){"use strict";function e(e,t,n){var r=null;return 0===t?e:function(){var a=n||this,o=arguments;clearTimeout(r),r=setTimeout(function(){e.apply(a,o)},t)}}var t,n,r=[],a=[],o=function(e,t,n){return void 0===n?e&&e.h5s&&e.h5s.data&&e.h5s.data[t]:(e.h5s=e.h5s||{},e.h5s.data=e.h5s.data||{},e.h5s.data[t]=n,void 0)},i=function(e){e.h5s&&delete e.h5s.data},s=function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)},l=function(e,t){if(!t)return Array.prototype.slice.call(e);for(var n=[],r=0;rn){var d=o-n,f=p(e).top;if(is&&a>f+o-d)return}void 0===t.oldDisplay&&(t.oldDisplay=t.style.display),"none"!==t.style.display&&(t.style.display="none"),i=m||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="move",w(this,e.pageY)))};d(v.concat(i),"dragover",C),d(v.concat(i),"dragenter",C)}),i};return q.destroy=function(e){C(e)},q.enable=function(e){A(e)},q.disable=function(e){D(e)},q});
+!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.sortable=t()}(this,function(){"use strict";function e(e,t,n){var r=null;return 0===t?e:function(){var a=n||this,o=arguments;clearTimeout(r),r=setTimeout(function(){e.apply(a,o)},t)}}var t,n,r=[],a=[],o=function(e,t,n){return void 0===n?e&&e.h5s&&e.h5s.data&&e.h5s.data[t]:(e.h5s=e.h5s||{},e.h5s.data=e.h5s.data||{},e.h5s.data[t]=n,void 0)},i=function(e){e.h5s&&delete e.h5s.data},s=function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)},l=function(e,t){if(!t)return Array.prototype.slice.call(e);for(var n=[],r=0;rn){var d=o-n,f=p(e).top;if(is&&a>f+o-d)return}void 0===t.oldDisplay&&(t.oldDisplay=t.style.display),"none"!==t.style.display&&(t.style.display="none"),i=v||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="move",C(this,e.pageY)))};d(y.concat(i),"dragover",S),d(y.concat(i),"dragenter",S)}),i};return q.destroy=function(e){C(e)},q.enable=function(e){A(e)},q.disable=function(e){S(e)},q});
//# sourceMappingURL=html.sortable.min.js.map
diff --git a/dist/html.sortable.min.js.map b/dist/html.sortable.min.js.map
index dccde2c2..6a7d070a 100644
--- a/dist/html.sortable.min.js.map
+++ b/dist/html.sortable.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["html.sortable.js"],"names":["root","factory","define","amd","exports","module","sortable","this","_debounce","fn","delay","context","timer","eContext","args","arguments","clearTimeout","setTimeout","apply","dragging","draggingHeight","placeholders","sortables","_data","element","key","value","undefined","h5s","data","_removeData","_matches","el","selector","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","call","_filter","nodes","wanted","Array","prototype","slice","result","i","length","push","indexOf","_on","event","callback","addEventListener","events","_off","removeEventListener","_attr","attribute","setAttribute","_removeAttr","removeAttribute","_offset","rect","getClientRects","left","window","scrollX","top","scrollY","_removeItemEvents","items","_removeSortableEvents","_attachGhost","ghost","dataTransfer","effectAllowed","setData","setDragImage","draggedItem","x","y","_addGhostPos","parseInt","pageX","pageY","_makeGhost","_getGhost","_removeSortableData","_removeItemData","_listsConnected","curList","destList","_getHandles","handle","handles","querySelectorAll","concat","_destroySortable","sortableElement","opts","_getChildren","_enableSortable","spanEl","document","createElement","dragDrop","disableIEFix","parent","parentElement","_disableSortable","_reloadSortable","_index","children","_attached","parentNode","_html2element","html","tagName","innerHTML","firstChild","_before","target","insertBefore","_after","nextElementSibling","_detach","removeChild","_makeEvent","name","detail","e","createEvent","initEvent","_dispatchEventOnConnected","forEach","dispatchEvent","sortableElements","options","method","String","connectWith","placeholder","placeholderClass","draggingClass","hoverClass","debounce","maxItems","option","getChildren","Element","test","index","startParent","classList","add","split","getAttribute","id","remove","stopImmediatePropagation","getComputedStyle","height","item","startparent","newParent","style","display","oldDisplay","oldindex","elementIndex","oldElementIndex","endparent","visiblePlaceholder","preventDefault","stopPropagation","filter","debouncedDragOverEnter","thisHeight","placeholderIndex","thisIndex","forcePlaceholderSize","deadZone","offsetTop","appendChild","onDragOverEnter","dropEffect","destroy","enable","disable"],"mappings":"CAAE,SAASA,EAAMC,GACO,kBAAXC,SAAyBA,OAAOC,IACzCD,UAAWD,GACiB,gBAAZG,SAChBC,OAAOD,QAAUH,IAEjBD,EAAKM,SAAWL,KAElBM,KAAM,WAYR,YA4aA,SAASC,GAAWC,EAAIC,EAAOC,GAC7B,GAAIC,GAAQ,IAEZ,OAAc,KAAVF,EACKD,EAEF,WACL,GAAII,GAAWF,GAAWJ,KACtBO,EAAOC,SACXC,cAAaJ,GACbA,EAAQK,WAAW,WACjBR,EAAGS,MAAML,EAAUC,IAClBJ,IApbP,GAAIS,GACAC,EACAC,KACAC,KAQAC,EAAQ,SAAUC,EAASC,EAAKC,GAClC,MAAcC,UAAVD,EACKF,GAAWA,EAAQI,KAAOJ,EAAQI,IAAIC,MAAQL,EAAQI,IAAIC,KAAKJ,IAEtED,EAAQI,IAAMJ,EAAQI,QACtBJ,EAAQI,IAAIC,KAAOL,EAAQI,IAAIC,SAC/BL,EAAQI,IAAIC,KAAKJ,GAAOC,EAFxBF,SASAM,EAAc,SAAUN,GACtBA,EAAQI,WACHJ,GAAQI,IAAIC,MAUnBE,EAAW,SAAUC,EAAIC,GAC3B,OAAQD,EAAGE,SAAWF,EAAGG,iBAAmBH,EAAGI,mBAAqBJ,EAAGK,oBAAsBL,EAAGM,uBAAyBN,EAAGO,kBAAkBC,KAAKR,EAAIC,IAQrJQ,EAAU,SAAUC,EAAOC,GAC7B,IAAKA,EACH,MAAOC,OAAMC,UAAUC,MAAMN,KAAKE,EAGpC,KAAK,GADDK,MACKC,EAAI,EAAGA,EAAIN,EAAMO,SAAUD,EACZ,gBAAXL,IAAuBZ,EAASW,EAAMM,GAA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C,EAAExD,aAAa+G,WAAa,OAC5BT,EAAuB5K,KAAM8H,EAAE9C,SAGjCnC,GAAIqB,EAAM0B,OAAOE,GAAkB,WAAYsF,GAC/CvI,EAAIqB,EAAM0B,OAAOE,GAAkB,YAAasF,KAG3ChD,EAgBT,OAbArI,GAASuL,QAAU,SAAUxF,GAC3BD,EAAiBC,IAGnB/F,EAASwL,OAAS,SAAUzF,GAC1BG,EAAgBH,IAGlB/F,EAASyL,QAAU,SAAU1F,GAC3BW,EAAiBX,IAIZ/F","file":"html.sortable.min.js","sourcesContent":[";(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.sortable = factory();\n }\n}(this, function() {\n/*\n * HTML5 Sortable library\n * https://github.com/voidberg/html5sortable\n *\n * Original code copyright 2012 Ali Farhadi.\n * This version is mantained by Lukas Oppermann \n * Previously also mantained by Alexandru Badiu \n * jQuery-independent implementation by Nazar Mokrynskyi \n *\n * Released under the MIT license.\n */\n'use strict'\n/*\n * variables global to the plugin\n */\nvar dragging\nvar draggingHeight\nvar placeholders = []\nvar sortables = []\n/**\n * Get or set data on element\n * @param {Element} element\n * @param {string} key\n * @param {*} value\n * @return {*}\n */\nvar _data = function (element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key]\n } else {\n element.h5s = element.h5s || {}\n element.h5s.data = element.h5s.data || {}\n element.h5s.data[key] = value\n }\n}\n/**\n * Remove data from element\n * @param {Element} element\n */\nvar _removeData = function (element) {\n if (element.h5s) {\n delete element.h5s.data\n }\n}\n/**\n * Tests if an element matches a given selector. Comparable to jQuery's $(el).is('.my-class')\n * @param {el} DOM element\n * @param {selector} selector test against the element\n * @returns {boolean}\n */\n/* istanbul ignore next */\nvar _matches = function (el, selector) {\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\n}\n/**\n * Filter only wanted nodes\n * @param {Array|NodeList} nodes\n * @param {Array/string} wanted\n * @returns {Array}\n */\nvar _filter = function (nodes, wanted) {\n if (!wanted) {\n return Array.prototype.slice.call(nodes)\n }\n var result = []\n for (var i = 0; i < nodes.length; ++i) {\n if (typeof wanted === 'string' && _matches(nodes[i], wanted)) {\n result.push(nodes[i])\n }\n if (wanted.indexOf(nodes[i]) !== -1) {\n result.push(nodes[i])\n }\n }\n return result\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n * @param {Function} callback\n */\nvar _on = function (element, event, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _on(element[i], event, callback)\n }\n return\n }\n element.addEventListener(event, callback)\n element.h5s = element.h5s || {}\n element.h5s.events = element.h5s.events || {}\n element.h5s.events[event] = callback\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n */\nvar _off = function (element, event) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _off(element[i], event)\n }\n return\n }\n if (element.h5s && element.h5s.events && element.h5s.events[event]) {\n element.removeEventListener(event, element.h5s.events[event])\n delete element.h5s.events[event]\n }\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n * @param {*} value\n */\nvar _attr = function (element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _attr(element[i], attribute, value)\n }\n return\n }\n element.setAttribute(attribute, value)\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n */\nvar _removeAttr = function (element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _removeAttr(element[i], attribute)\n }\n return\n }\n element.removeAttribute(attribute)\n}\n/**\n * @param {Element} element\n * @returns {{left: *, top: *}}\n */\nvar _offset = function (element) {\n var rect = element.getClientRects()[0]\n return {\n left: rect.left + window.scrollX,\n top: rect.top + window.scrollY\n }\n}\n/*\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n _off(items, 'dragstart')\n _off(items, 'dragend')\n _off(items, 'selectstart')\n _off(items, 'dragover')\n _off(items, 'dragenter')\n _off(items, 'drop')\n}\n/*\n * Remove event handlers from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableEvents = function (sortable) {\n _off(sortable, 'dragover')\n _off(sortable, 'dragenter')\n _off(sortable, 'drop')\n}\n/*\n * Attach ghost to dataTransfer object\n * @param {Event} original event\n * @param {object} ghost-object with item, x and y coordinates\n */\nvar _attachGhost = function (event, ghost) {\n // this needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'move'\n event.dataTransfer.setData('text', '')\n\n // check if setDragImage method is available\n if (event.dataTransfer.setDragImage) {\n event.dataTransfer.setDragImage(ghost.draggedItem, ghost.x, ghost.y)\n }\n}\n/**\n * _addGhostPos clones the dragged item and adds it as a Ghost item\n * @param {Event} event - the event fired when dragstart is triggered\n * @param {object} ghost - .draggedItem = Element\n */\nvar _addGhostPos = function (event, ghost) {\n if (!ghost.x) {\n ghost.x = parseInt(event.pageX - _offset(ghost.draggedItem).left)\n }\n if (!ghost.y) {\n ghost.y = parseInt(event.pageY - _offset(ghost.draggedItem).top)\n }\n return ghost\n}\n/**\n * _makeGhost decides which way to make a ghost and passes it to attachGhost\n * @param {Element} draggedItem - the item that the user drags\n */\nvar _makeGhost = function (draggedItem) {\n return {\n draggedItem: draggedItem\n }\n}\n/**\n * _getGhost constructs ghost and attaches it to dataTransfer\n * @param {Event} event - the original drag event object\n * @param {Element} draggedItem - the item that the user drags\n */\n// TODO: could draggedItem be replaced by event.target in all instances\nvar _getGhost = function (event, draggedItem) {\n // add ghost item & draggedItem to ghost object\n var ghost = _makeGhost(draggedItem)\n // attach ghost position\n ghost = _addGhostPos(event, ghost)\n // attach ghost to dataTransfer\n _attachGhost(event, ghost)\n}\n/*\n * Remove data from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n _removeData(sortable)\n _removeAttr(sortable, 'aria-dropeffect')\n}\n/*\n * Remove data from items\n * @param {Array|Element} items\n */\nvar _removeItemData = function (items) {\n _removeAttr(items, 'aria-grabbed')\n _removeAttr(items, 'draggable')\n _removeAttr(items, 'role')\n}\n/*\n * Check if two lists are connected\n * @param {Element} curList\n * @param {Element} destList\n */\nvar _listsConnected = function (curList, destList) {\n if (curList === destList) {\n return true\n }\n if (_data(curList, 'connectWith') !== undefined) {\n return _data(curList, 'connectWith') === _data(destList, 'connectWith')\n }\n return false\n}\n/*\n * get handle or return item\n * @param {Array} items\n * @param {selector} handle\n */\nvar _getHandles = function (items, handle) {\n var result = []\n var handles\n if (!handle) {\n return items\n }\n for (var i = 0; i < items.length; ++i) {\n handles = items[i].querySelectorAll(handle)\n result = result.concat(Array.prototype.slice.call(handles))\n }\n return result\n}\n/*\n * Destroy the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts') || {}\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n // remove event handlers & data from sortable\n _removeSortableEvents(sortableElement)\n _removeSortableData(sortableElement)\n // remove event handlers & data from items\n _off(handles, 'mousedown')\n _removeItemEvents(items)\n _removeItemData(items)\n}\n/*\n * Enable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'move')\n _data(sortableElement, '_disabled', 'false')\n _attr(handles, 'draggable', 'true')\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n var spanEl = (document || window.document).createElement('span')\n if (typeof spanEl.dragDrop === 'function' && !opts.disableIEFix) {\n _on(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop()\n } else {\n var parent = this.parentElement\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement\n }\n parent.dragDrop()\n }\n })\n }\n}\n/*\n * Disable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'none')\n _data(sortableElement, '_disabled', 'true')\n _attr(handles, 'draggable', 'false')\n _off(handles, 'mousedown')\n}\n/*\n * Reload the sortable\n * @param {Element} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _data(sortableElement, '_disabled', 'false')\n // remove event handlers from items\n _removeItemEvents(items)\n _off(handles, 'mousedown')\n // remove event handlers from sortable\n _removeSortableEvents(sortableElement)\n}\n/**\n * Get position of the element relatively to its sibling elements\n * @param {Element} element\n * @returns {number}\n */\nvar _index = function (element) {\n if (!element.parentElement) {\n return 0\n }\n return Array.prototype.indexOf.call(element.parentElement.children, element)\n}\n/**\n * Whether element is in DOM\n * @param {Element} element\n * @returns {boolean}\n */\nvar _attached = function (element) {\n // document.body.contains(element)\n return !!element.parentNode\n}\n/**\n * Convert HTML string into DOM element.\n * @param {Element|string} html\n * @param {string} tagname\n * @returns {Element}\n */\nvar _html2element = function (html, tagName) {\n if (typeof html !== 'string') {\n return html\n }\n var parentElement = document.createElement(tagName)\n parentElement.innerHTML = html\n return parentElement.firstChild\n}\n/**\n * Insert before target\n * @param {Element} target\n * @param {Element} element\n */\nvar _before = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target\n )\n}\n/**\n * Insert after target\n * @param {Element} target\n * @param {Element} element\n */\nvar _after = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target.nextElementSibling\n )\n}\n/**\n * Detach element from DOM\n * @param {Element} element\n */\nvar _detach = function (element) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n }\n}\n/**\n * Make native event that can be dispatched afterwards\n * @param {string} name\n * @param {object} detail\n * @returns {CustomEvent}\n */\nvar _makeEvent = function (name, detail) {\n var e = document.createEvent('Event')\n if (detail) {\n e.detail = detail\n }\n e.initEvent(name, false, true)\n return e\n}\n/**\n * @param {Element} sortableElement\n * @param {CustomEvent} event\n */\nvar _dispatchEventOnConnected = function (sortableElement, event) {\n sortables.forEach(function (target) {\n if (_listsConnected(sortableElement, target)) {\n target.dispatchEvent(event)\n }\n })\n}\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {fn} Function to debounce\n * @param {delay} time to wait before calling function with latest arguments, 0 - no debounce\n * @param {context} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nfunction _debounce (fn, delay, context) {\n var timer = null\n\n if (delay === 0) {\n return fn\n }\n return function () {\n var eContext = context || this\n var args = arguments\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(eContext, args)\n }, delay)\n }\n}\n\nvar _getChildren = function (element) {\n return element.children\n}\n\n/*\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nvar sortable = function (sortableElements, options) {\n var method = String(options)\n\n options = (function (options) {\n var result = {\n connectWith: false,\n placeholder: null,\n disableIEFix: false,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n debounce: 0,\n maxItems: 0\n }\n for (var option in options) {\n result[option] = options[option]\n }\n return result\n })(options)\n\n if (options && typeof options.getChildren === 'function') {\n _getChildren = options.getChildren\n }\n\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements)\n }\n\n if (sortableElements instanceof window.Element) {\n sortableElements = [sortableElements]\n }\n\n sortableElements = Array.prototype.slice.call(sortableElements)\n\n /* TODO: maxstatements should be 25, fix and remove line below */\n /* jshint maxstatements:false */\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n sortable[method](sortableElement)\n return\n }\n\n // get options & set options on sortable\n options = _data(sortableElement, 'opts') || options\n _data(sortableElement, 'opts', options)\n // reset sortable\n _reloadSortable(sortableElement)\n // initialize\n var items = _filter(_getChildren(sortableElement), options.items)\n var index\n var startParent\n var placeholder = options.placeholder\n var maxItems\n if (!placeholder) {\n placeholder = document.createElement(\n /^ul|ol$/i.test(sortableElement.tagName) ? 'li' : 'div'\n )\n }\n placeholder = _html2element(placeholder, sortableElement.tagName)\n placeholder.classList.add.apply(\n placeholder.classList,\n options.placeholderClass.split(' ')\n )\n\n // setup sortable ids\n if (!sortableElement.getAttribute('data-sortable-id')) {\n var id = sortables.length\n sortables[id] = sortableElement\n _attr(sortableElement, 'data-sortable-id', id)\n _attr(items, 'data-item-sortable-id', id)\n }\n\n _data(sortableElement, 'items', options.items)\n placeholders.push(placeholder)\n if (options.connectWith) {\n _data(sortableElement, 'connectWith', options.connectWith)\n }\n\n _enableSortable(sortableElement)\n _attr(items, 'role', 'option')\n _attr(items, 'aria-grabbed', 'false')\n\n // Mouse over class\n if (options.hoverClass) {\n var hoverClass = 'sortable-over'\n if (typeof options.hoverClass === 'string') {\n hoverClass = options.hoverClass\n }\n\n _on(items, 'mouseenter', function () {\n this.classList.add(hoverClass)\n })\n _on(items, 'mouseleave', function () {\n this.classList.remove(hoverClass)\n })\n }\n\n // max items\n if (options.maxItems && typeof options.maxItems === 'number') {\n maxItems = options.maxItems\n }\n\n // Handle drag events on draggable items\n _on(items, 'dragstart', function (e) {\n e.stopImmediatePropagation()\n if ((options.handle && !_matches(e.target, options.handle)) || this.getAttribute('draggable') === 'false') {\n return\n }\n\n // add transparent clone or other ghost to cursor\n _getGhost(e, this)\n // cache selsection & add attr for dragging\n this.classList.add(options.draggingClass)\n dragging = this\n _attr(dragging, 'aria-grabbed', 'true')\n // grab values\n index = _index(dragging)\n draggingHeight = parseInt(window.getComputedStyle(dragging).height)\n startParent = this.parentElement\n // dispatch sortstart event on each element in group\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstart', {\n item: dragging,\n placeholder: placeholder,\n startparent: startParent\n }))\n })\n // Handle drag events on draggable items\n _on(items, 'dragend', function () {\n var newParent\n if (!dragging) {\n return\n }\n // remove dragging attributes and show item\n dragging.classList.remove(options.draggingClass)\n _attr(dragging, 'aria-grabbed', 'false')\n dragging.style.display = dragging.oldDisplay\n delete dragging.oldDisplay\n\n placeholders.forEach(_detach)\n newParent = this.parentElement\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstop', {\n item: dragging,\n startparent: startParent\n }))\n if (index !== _index(dragging) || startParent !== newParent) {\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortupdate', {\n item: dragging,\n index: _filter(_getChildren(newParent), _data(newParent, 'items'))\n .indexOf(dragging),\n oldindex: items.indexOf(dragging),\n elementIndex: _index(dragging),\n oldElementIndex: index,\n startparent: startParent,\n endparent: newParent\n }))\n }\n dragging = null\n draggingHeight = null\n })\n // Handle drop event on sortable & placeholder\n // TODO: REMOVE placeholder?????\n _on([sortableElement, placeholder], 'drop', function (e) {\n var visiblePlaceholder\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return\n }\n\n e.preventDefault()\n e.stopPropagation()\n visiblePlaceholder = placeholders.filter(_attached)[0]\n _after(visiblePlaceholder, dragging)\n dragging.dispatchEvent(_makeEvent('dragend'))\n })\n\n var debouncedDragOverEnter = _debounce(function (element, pageY) {\n if (!dragging) {\n return\n }\n\n if (items.indexOf(element) !== -1) {\n var thisHeight = parseInt(window.getComputedStyle(element).height)\n var placeholderIndex = _index(placeholder)\n var thisIndex = _index(element)\n if (options.forcePlaceholderSize) {\n placeholder.style.height = draggingHeight + 'px'\n }\n\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight) {\n // Dead zone?\n var deadZone = thisHeight - draggingHeight\n var offsetTop = _offset(element).top\n if (placeholderIndex < thisIndex &&\n pageY < offsetTop + deadZone) {\n return\n }\n if (placeholderIndex > thisIndex &&\n pageY > offsetTop + thisHeight - deadZone) {\n return\n }\n }\n\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display\n }\n\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none'\n }\n\n if (placeholderIndex < thisIndex) {\n _after(element, placeholder)\n } else {\n _before(element, placeholder)\n }\n // Intentionally violated chaining, it is more complex otherwise\n placeholders\n .filter(function (element) { return element !== placeholder })\n .forEach(_detach)\n } else {\n if (placeholders.indexOf(element) === -1 &&\n !_filter(_getChildren(element), options.items).length) {\n placeholders.forEach(_detach)\n element.appendChild(placeholder)\n }\n }\n }, options.debounce)\n\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || _data(sortableElement, '_disabled') === 'true') {\n return\n }\n if (maxItems && _filter(_getChildren(sortableElement), _data(sortableElement, 'items')).length >= maxItems) {\n return\n }\n e.preventDefault()\n e.stopPropagation()\n e.dataTransfer.dropEffect = 'move'\n debouncedDragOverEnter(this, e.pageY)\n }\n\n _on(items.concat(sortableElement), 'dragover', onDragOverEnter)\n _on(items.concat(sortableElement), 'dragenter', onDragOverEnter)\n })\n\n return sortableElements\n}\n\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement)\n}\n\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement)\n}\n\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement)\n}\n\n\nreturn sortable;\n}));\n"]}
\ No newline at end of file
+{"version":3,"sources":["html.sortable.min.js"],"names":["root","factory","define","amd","exports","module","sortable","this","_debounce","fn","delay","context","timer","eContext","args","arguments","clearTimeout","setTimeout","apply","dragging","draggingHeight","placeholders","sortables","_data","element","key","value","undefined","h5s","data","_removeData","_matches","el","selector","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","call","_filter","nodes","wanted","Array","prototype","slice","result","i","length","push","indexOf","_on","event","callback","addEventListener","events","_off","removeEventListener","_attr","attribute","setAttribute","_removeAttr","removeAttribute","_offset","rect","getClientRects","left","window","scrollX","top","scrollY","_removeItemEvents","items","_removeSortableEvents","_attachGhost","ghost","dataTransfer","effectAllowed","setData","setDragImage","draggedItem","x","y","_addGhostPos","parseInt","pageX","pageY","_makeGhost","_getGhost","_removeSortableData","_removeItemData","_listsConnected","curList","destList","_getHandles","handle","handles","querySelectorAll","concat","_destroySortable","sortableElement","opts","_getChildren","_enableSortable","spanEl","document","createElement","dragDrop","disableIEFix","parent","parentElement","_disableSortable","_reloadSortable","_index","children","_attached","parentNode","_html2element","html","tagName","innerHTML","firstChild","_before","target","insertBefore","_after","nextElementSibling","_detach","removeChild","_makeEvent","name","detail","e","createEvent","initEvent","_dispatchEventOnConnected","forEach","dispatchEvent","_serialize","list","sortableElements","options","method","String","connectWith","placeholder","placeholderClass","draggingClass","hoverClass","debounce","maxItems","option","getChildren","Element","test","serialized","index","startParent","startList","classList","add","split","getAttribute","id","remove","stopImmediatePropagation","getComputedStyle","height","item","startparent","newParent","style","display","oldDisplay","oldindex","elementIndex","oldElementIndex","endparent","newEndList","newStartList","oldStartList","visiblePlaceholder","preventDefault","stopPropagation","filter","debouncedDragOverEnter","thisHeight","placeholderIndex","thisIndex","forcePlaceholderSize","deadZone","offsetTop","appendChild","onDragOverEnter","dropEffect","destroy","enable","disable"],"mappings":"CAAE,SAASA,EAAMC,GACO,kBAAXC,SAAyBA,OAAOC,IACzCD,UAAWD,GACiB,gBAAZG,SAChBC,OAAOD,QAAUH,IAEjBD,EAAKM,SAAWL,KAElBM,KAAM,WAYR,YA4aA,SAASC,GAAWC,EAAIC,EAAOC,GAC7B,GAAIC,GAAQ,IAEZ,OAAc,KAAVF,EACKD,EAEF,WACL,GAAII,GAAWF,GAAWJ,KACtBO,EAAOC,SACXC,cAAaJ,GACbA,EAAQK,WAAW,WACjBR,EAAGS,MAAML,EAAUC,IAClBJ,IApbP,GAAIS,GACAC,EACAC,KACAC,KAQAC,EAAQ,SAAU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G,GAC1BG,EAAgBH,IAGlB/F,EAASgM,QAAU,SAAUjG,GAC3BW,EAAiBX,IAIZ/F","file":"html.sortable.min.js","sourcesContent":[";(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.sortable = factory();\n }\n}(this, function() {\n/*\n * HTML5 Sortable library\n * https://github.com/voidberg/html5sortable\n *\n * Original code copyright 2012 Ali Farhadi.\n * This version is mantained by Lukas Oppermann \n * Previously also mantained by Alexandru Badiu \n * jQuery-independent implementation by Nazar Mokrynskyi \n *\n * Released under the MIT license.\n */\n'use strict'\n/*\n * variables global to the plugin\n */\nvar dragging\nvar draggingHeight\nvar placeholders = []\nvar sortables = []\n/**\n * Get or set data on element\n * @param {Element} element\n * @param {string} key\n * @param {*} value\n * @return {*}\n */\nvar _data = function (element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key]\n } else {\n element.h5s = element.h5s || {}\n element.h5s.data = element.h5s.data || {}\n element.h5s.data[key] = value\n }\n}\n/**\n * Remove data from element\n * @param {Element} element\n */\nvar _removeData = function (element) {\n if (element.h5s) {\n delete element.h5s.data\n }\n}\n/**\n * Tests if an element matches a given selector. Comparable to jQuery's $(el).is('.my-class')\n * @param {el} DOM element\n * @param {selector} selector test against the element\n * @returns {boolean}\n */\n/* istanbul ignore next */\nvar _matches = function (el, selector) {\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\n}\n/**\n * Filter only wanted nodes\n * @param {Array|NodeList} nodes\n * @param {Array/string} wanted\n * @returns {Array}\n */\nvar _filter = function (nodes, wanted) {\n if (!wanted) {\n return Array.prototype.slice.call(nodes)\n }\n var result = []\n for (var i = 0; i < nodes.length; ++i) {\n if (typeof wanted === 'string' && _matches(nodes[i], wanted)) {\n result.push(nodes[i])\n }\n if (wanted.indexOf(nodes[i]) !== -1) {\n result.push(nodes[i])\n }\n }\n return result\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n * @param {Function} callback\n */\nvar _on = function (element, event, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _on(element[i], event, callback)\n }\n return\n }\n element.addEventListener(event, callback)\n element.h5s = element.h5s || {}\n element.h5s.events = element.h5s.events || {}\n element.h5s.events[event] = callback\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n */\nvar _off = function (element, event) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _off(element[i], event)\n }\n return\n }\n if (element.h5s && element.h5s.events && element.h5s.events[event]) {\n element.removeEventListener(event, element.h5s.events[event])\n delete element.h5s.events[event]\n }\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n * @param {*} value\n */\nvar _attr = function (element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _attr(element[i], attribute, value)\n }\n return\n }\n element.setAttribute(attribute, value)\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n */\nvar _removeAttr = function (element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _removeAttr(element[i], attribute)\n }\n return\n }\n element.removeAttribute(attribute)\n}\n/**\n * @param {Element} element\n * @returns {{left: *, top: *}}\n */\nvar _offset = function (element) {\n var rect = element.getClientRects()[0]\n return {\n left: rect.left + window.scrollX,\n top: rect.top + window.scrollY\n }\n}\n/*\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n _off(items, 'dragstart')\n _off(items, 'dragend')\n _off(items, 'selectstart')\n _off(items, 'dragover')\n _off(items, 'dragenter')\n _off(items, 'drop')\n}\n/*\n * Remove event handlers from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableEvents = function (sortable) {\n _off(sortable, 'dragover')\n _off(sortable, 'dragenter')\n _off(sortable, 'drop')\n}\n/*\n * Attach ghost to dataTransfer object\n * @param {Event} original event\n * @param {object} ghost-object with item, x and y coordinates\n */\nvar _attachGhost = function (event, ghost) {\n // this needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'move'\n event.dataTransfer.setData('text', '')\n\n // check if setDragImage method is available\n if (event.dataTransfer.setDragImage) {\n event.dataTransfer.setDragImage(ghost.draggedItem, ghost.x, ghost.y)\n }\n}\n/**\n * _addGhostPos clones the dragged item and adds it as a Ghost item\n * @param {Event} event - the event fired when dragstart is triggered\n * @param {object} ghost - .draggedItem = Element\n */\nvar _addGhostPos = function (event, ghost) {\n if (!ghost.x) {\n ghost.x = parseInt(event.pageX - _offset(ghost.draggedItem).left)\n }\n if (!ghost.y) {\n ghost.y = parseInt(event.pageY - _offset(ghost.draggedItem).top)\n }\n return ghost\n}\n/**\n * _makeGhost decides which way to make a ghost and passes it to attachGhost\n * @param {Element} draggedItem - the item that the user drags\n */\nvar _makeGhost = function (draggedItem) {\n return {\n draggedItem: draggedItem\n }\n}\n/**\n * _getGhost constructs ghost and attaches it to dataTransfer\n * @param {Event} event - the original drag event object\n * @param {Element} draggedItem - the item that the user drags\n */\n// TODO: could draggedItem be replaced by event.target in all instances\nvar _getGhost = function (event, draggedItem) {\n // add ghost item & draggedItem to ghost object\n var ghost = _makeGhost(draggedItem)\n // attach ghost position\n ghost = _addGhostPos(event, ghost)\n // attach ghost to dataTransfer\n _attachGhost(event, ghost)\n}\n/*\n * Remove data from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n _removeData(sortable)\n _removeAttr(sortable, 'aria-dropeffect')\n}\n/*\n * Remove data from items\n * @param {Array|Element} items\n */\nvar _removeItemData = function (items) {\n _removeAttr(items, 'aria-grabbed')\n _removeAttr(items, 'draggable')\n _removeAttr(items, 'role')\n}\n/*\n * Check if two lists are connected\n * @param {Element} curList\n * @param {Element} destList\n */\nvar _listsConnected = function (curList, destList) {\n if (curList === destList) {\n return true\n }\n if (_data(curList, 'connectWith') !== undefined) {\n return _data(curList, 'connectWith') === _data(destList, 'connectWith')\n }\n return false\n}\n/*\n * get handle or return item\n * @param {Array} items\n * @param {selector} handle\n */\nvar _getHandles = function (items, handle) {\n var result = []\n var handles\n if (!handle) {\n return items\n }\n for (var i = 0; i < items.length; ++i) {\n handles = items[i].querySelectorAll(handle)\n result = result.concat(Array.prototype.slice.call(handles))\n }\n return result\n}\n/*\n * Destroy the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts') || {}\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n // remove event handlers & data from sortable\n _removeSortableEvents(sortableElement)\n _removeSortableData(sortableElement)\n // remove event handlers & data from items\n _off(handles, 'mousedown')\n _removeItemEvents(items)\n _removeItemData(items)\n}\n/*\n * Enable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'move')\n _data(sortableElement, '_disabled', 'false')\n _attr(handles, 'draggable', 'true')\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n var spanEl = (document || window.document).createElement('span')\n if (typeof spanEl.dragDrop === 'function' && !opts.disableIEFix) {\n _on(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop()\n } else {\n var parent = this.parentElement\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement\n }\n parent.dragDrop()\n }\n })\n }\n}\n/*\n * Disable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'none')\n _data(sortableElement, '_disabled', 'true')\n _attr(handles, 'draggable', 'false')\n _off(handles, 'mousedown')\n}\n/*\n * Reload the sortable\n * @param {Element} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _data(sortableElement, '_disabled', 'false')\n // remove event handlers from items\n _removeItemEvents(items)\n _off(handles, 'mousedown')\n // remove event handlers from sortable\n _removeSortableEvents(sortableElement)\n}\n/**\n * Get position of the element relatively to its sibling elements\n * @param {Element} element\n * @returns {number}\n */\nvar _index = function (element) {\n if (!element.parentElement) {\n return 0\n }\n return Array.prototype.indexOf.call(element.parentElement.children, element)\n}\n/**\n * Whether element is in DOM\n * @param {Element} element\n * @returns {boolean}\n */\nvar _attached = function (element) {\n // document.body.contains(element)\n return !!element.parentNode\n}\n/**\n * Convert HTML string into DOM element.\n * @param {Element|string} html\n * @param {string} tagname\n * @returns {Element}\n */\nvar _html2element = function (html, tagName) {\n if (typeof html !== 'string') {\n return html\n }\n var parentElement = document.createElement(tagName)\n parentElement.innerHTML = html\n return parentElement.firstChild\n}\n/**\n * Insert before target\n * @param {Element} target\n * @param {Element} element\n */\nvar _before = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target\n )\n}\n/**\n * Insert after target\n * @param {Element} target\n * @param {Element} element\n */\nvar _after = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target.nextElementSibling\n )\n}\n/**\n * Detach element from DOM\n * @param {Element} element\n */\nvar _detach = function (element) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n }\n}\n/**\n * Make native event that can be dispatched afterwards\n * @param {string} name\n * @param {object} detail\n * @returns {CustomEvent}\n */\nvar _makeEvent = function (name, detail) {\n var e = document.createEvent('Event')\n if (detail) {\n e.detail = detail\n }\n e.initEvent(name, false, true)\n return e\n}\n/**\n * @param {Element} sortableElement\n * @param {CustomEvent} event\n */\nvar _dispatchEventOnConnected = function (sortableElement, event) {\n sortables.forEach(function (target) {\n if (_listsConnected(sortableElement, target)) {\n target.dispatchEvent(event)\n }\n })\n}\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {fn} Function to debounce\n * @param {delay} time to wait before calling function with latest arguments, 0 - no debounce\n * @param {context} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nfunction _debounce (fn, delay, context) {\n var timer = null\n\n if (delay === 0) {\n return fn\n }\n return function () {\n var eContext = context || this\n var args = arguments\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(eContext, args)\n }, delay)\n }\n}\n\nvar _getChildren = function (element) {\n return element.children\n}\n\nvar _serialize = function (list) {\n var children = _filter(_getChildren(list), _data(list, 'items'))\n return children\n}\n\n/*\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nvar sortable = function (sortableElements, options) {\n var method = String(options)\n\n options = (function (options) {\n var result = {\n connectWith: false,\n placeholder: null,\n disableIEFix: false,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n debounce: 0,\n maxItems: 0\n }\n for (var option in options) {\n result[option] = options[option]\n }\n return result\n })(options)\n\n if (options && typeof options.getChildren === 'function') {\n _getChildren = options.getChildren\n }\n\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements)\n }\n\n if (sortableElements instanceof window.Element) {\n sortableElements = [sortableElements]\n }\n\n sortableElements = Array.prototype.slice.call(sortableElements)\n\n if (/serialize/.test(method)) {\n var serialized = []\n sortableElements.forEach(function (sortableElement) {\n serialized.push({\n list: sortableElement,\n children: _serialize(sortableElement)\n })\n })\n return serialized\n }\n\n /* TODO: maxstatements should be 25, fix and remove line below */\n /* jshint maxstatements:false */\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement)\n }\n\n // get options & set options on sortable\n options = _data(sortableElement, 'opts') || options\n _data(sortableElement, 'opts', options)\n // reset sortable\n _reloadSortable(sortableElement)\n // initialize\n var items = _filter(_getChildren(sortableElement), options.items)\n var index\n var startParent\n var startList\n var placeholder = options.placeholder\n var maxItems\n if (!placeholder) {\n placeholder = document.createElement(\n /^ul|ol$/i.test(sortableElement.tagName) ? 'li' : 'div'\n )\n }\n placeholder = _html2element(placeholder, sortableElement.tagName)\n placeholder.classList.add.apply(\n placeholder.classList,\n options.placeholderClass.split(' ')\n )\n\n // setup sortable ids\n if (!sortableElement.getAttribute('data-sortable-id')) {\n var id = sortables.length\n sortables[id] = sortableElement\n _attr(sortableElement, 'data-sortable-id', id)\n _attr(items, 'data-item-sortable-id', id)\n }\n\n _data(sortableElement, 'items', options.items)\n placeholders.push(placeholder)\n if (options.connectWith) {\n _data(sortableElement, 'connectWith', options.connectWith)\n }\n\n _enableSortable(sortableElement)\n _attr(items, 'role', 'option')\n _attr(items, 'aria-grabbed', 'false')\n\n // Mouse over class\n if (options.hoverClass) {\n var hoverClass = 'sortable-over'\n if (typeof options.hoverClass === 'string') {\n hoverClass = options.hoverClass\n }\n\n _on(items, 'mouseenter', function () {\n this.classList.add(hoverClass)\n })\n _on(items, 'mouseleave', function () {\n this.classList.remove(hoverClass)\n })\n }\n\n // max items\n if (options.maxItems && typeof options.maxItems === 'number') {\n maxItems = options.maxItems\n }\n\n // Handle drag events on draggable items\n _on(items, 'dragstart', function (e) {\n e.stopImmediatePropagation()\n if ((options.handle && !_matches(e.target, options.handle)) || this.getAttribute('draggable') === 'false') {\n return\n }\n\n // add transparent clone or other ghost to cursor\n _getGhost(e, this)\n // cache selsection & add attr for dragging\n this.classList.add(options.draggingClass)\n dragging = this\n _attr(dragging, 'aria-grabbed', 'true')\n // grab values\n index = _index(dragging)\n draggingHeight = parseInt(window.getComputedStyle(dragging).height)\n startParent = this.parentElement\n startList = _serialize(startParent)\n // dispatch sortstart event on each element in group\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstart', {\n item: dragging,\n placeholder: placeholder,\n startparent: startParent\n }))\n })\n // Handle drag events on draggable items\n _on(items, 'dragend', function () {\n var newParent\n if (!dragging) {\n return\n }\n // remove dragging attributes and show item\n dragging.classList.remove(options.draggingClass)\n _attr(dragging, 'aria-grabbed', 'false')\n dragging.style.display = dragging.oldDisplay\n delete dragging.oldDisplay\n\n placeholders.forEach(_detach)\n newParent = this.parentElement\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstop', {\n item: dragging,\n startparent: startParent\n }))\n if (index !== _index(dragging) || startParent !== newParent) {\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortupdate', {\n item: dragging,\n index: _filter(_getChildren(newParent), _data(newParent, 'items'))\n .indexOf(dragging),\n oldindex: items.indexOf(dragging),\n elementIndex: _index(dragging),\n oldElementIndex: index,\n startparent: startParent,\n endparent: newParent,\n newEndList: _serialize(newParent),\n newStartList: _serialize(startParent),\n oldStartList: startList\n }))\n }\n dragging = null\n draggingHeight = null\n })\n // Handle drop event on sortable & placeholder\n // TODO: REMOVE placeholder?????\n _on([sortableElement, placeholder], 'drop', function (e) {\n var visiblePlaceholder\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return\n }\n\n e.preventDefault()\n e.stopPropagation()\n visiblePlaceholder = placeholders.filter(_attached)[0]\n _after(visiblePlaceholder, dragging)\n dragging.dispatchEvent(_makeEvent('dragend'))\n })\n\n var debouncedDragOverEnter = _debounce(function (element, pageY) {\n if (!dragging) {\n return\n }\n\n if (items.indexOf(element) !== -1) {\n var thisHeight = parseInt(window.getComputedStyle(element).height)\n var placeholderIndex = _index(placeholder)\n var thisIndex = _index(element)\n if (options.forcePlaceholderSize) {\n placeholder.style.height = draggingHeight + 'px'\n }\n\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight) {\n // Dead zone?\n var deadZone = thisHeight - draggingHeight\n var offsetTop = _offset(element).top\n if (placeholderIndex < thisIndex &&\n pageY < offsetTop + deadZone) {\n return\n }\n if (placeholderIndex > thisIndex &&\n pageY > offsetTop + thisHeight - deadZone) {\n return\n }\n }\n\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display\n }\n\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none'\n }\n\n if (placeholderIndex < thisIndex) {\n _after(element, placeholder)\n } else {\n _before(element, placeholder)\n }\n // Intentionally violated chaining, it is more complex otherwise\n placeholders\n .filter(function (element) { return element !== placeholder })\n .forEach(_detach)\n } else {\n if (placeholders.indexOf(element) === -1 &&\n !_filter(_getChildren(element), options.items).length) {\n placeholders.forEach(_detach)\n element.appendChild(placeholder)\n }\n }\n }, options.debounce)\n\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || _data(sortableElement, '_disabled') === 'true') {\n return\n }\n if (maxItems && _filter(_getChildren(sortableElement), _data(sortableElement, 'items')).length >= maxItems) {\n return\n }\n e.preventDefault()\n e.stopPropagation()\n e.dataTransfer.dropEffect = 'move'\n debouncedDragOverEnter(this, e.pageY)\n }\n\n _on(items.concat(sortableElement), 'dragover', onDragOverEnter)\n _on(items.concat(sortableElement), 'dragenter', onDragOverEnter)\n })\n\n return sortableElements\n}\n\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement)\n}\n\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement)\n}\n\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement)\n}\n\n\nreturn sortable;\n}));\n"]}
\ No newline at end of file
diff --git a/docs/html.sortable.min.js b/docs/html.sortable.min.js
index 2aa8597d..89e98925 100644
--- a/docs/html.sortable.min.js
+++ b/docs/html.sortable.min.js
@@ -1,2 +1,2 @@
-!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.sortable=t()}(this,function(){"use strict";function e(e,t,n){var r=null;return 0===t?e:function(){var a=n||this,o=arguments;clearTimeout(r),r=setTimeout(function(){e.apply(a,o)},t)}}var t,n,r=[],a=[],o=function(e,t,n){return void 0===n?e&&e.h5s&&e.h5s.data&&e.h5s.data[t]:(e.h5s=e.h5s||{},e.h5s.data=e.h5s.data||{},e.h5s.data[t]=n,void 0)},i=function(e){e.h5s&&delete e.h5s.data},s=function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)},l=function(e,t){if(!t)return Array.prototype.slice.call(e);for(var n=[],r=0;rn){var d=o-n,f=p(e).top;if(is&&a>f+o-d)return}void 0===t.oldDisplay&&(t.oldDisplay=t.style.display),"none"!==t.style.display&&(t.style.display="none"),i=v||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="move",C(this,e.pageY)))};d(y.concat(i),"dragover",S),d(y.concat(i),"dragenter",S)}),i};return z.destroy=function(e){C(e)},z.enable=function(e){A(e)},z.disable=function(e){S(e)},z});
+!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.sortable=t()}(this,function(){"use strict";function e(e,t,n){var r=null;return 0===t?e:function(){var a=n||this,o=arguments;clearTimeout(r),r=setTimeout(function(){e.apply(a,o)},t)}}var t,n,r=[],a=[],o=function(e,t,n){return void 0===n?e&&e.h5s&&e.h5s.data&&e.h5s.data[t]:(e.h5s=e.h5s||{},e.h5s.data=e.h5s.data||{},e.h5s.data[t]=n,void 0)},i=function(e){e.h5s&&delete e.h5s.data},s=function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)},l=function(e,t){if(!t)return Array.prototype.slice.call(e);for(var n=[],r=0;rn){var d=o-n,f=p(e).top;if(is&&a>f+o-d)return}void 0===t.oldDisplay&&(t.oldDisplay=t.style.display),"none"!==t.style.display&&(t.style.display="none"),i=v||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="move",C(this,e.pageY)))};d(y.concat(i),"dragover",S),d(y.concat(i),"dragenter",S)}),i};return q.destroy=function(e){C(e)},q.enable=function(e){A(e)},q.disable=function(e){S(e)},q});
//# sourceMappingURL=html.sortable.min.js.map
diff --git a/docs/html.sortable.min.js.map b/docs/html.sortable.min.js.map
index 0e3c4f12..6a7d070a 100644
--- a/docs/html.sortable.min.js.map
+++ b/docs/html.sortable.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["html.sortable.js"],"names":["root","factory","define","amd","exports","module","sortable","this","_debounce","fn","delay","context","timer","eContext","args","arguments","clearTimeout","setTimeout","apply","dragging","draggingHeight","placeholders","sortables","_data","element","key","value","undefined","h5s","data","_removeData","_matches","el","selector","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","call","_filter","nodes","wanted","Array","prototype","slice","result","i","length","push","indexOf","_on","event","callback","addEventListener","events","_off","removeEventListener","_attr","attribute","setAttribute","_removeAttr","removeAttribute","_offset","rect","getClientRects","left","window","scrollX","top","scrollY","_removeItemEvents","items","_removeSortableEvents","_attachGhost","ghost","dataTransfer","effectAllowed","setData","setDragImage","draggedItem","x","y","_addGhostPos","parseInt","pageX","pageY","_makeGhost","_getGhost","_removeSortableData","_removeItemData","_listsConnected","curList","destList","_getHandles","handle","handles","querySelectorAll","concat","_destroySortable","sortableElement","opts","_getChildren","_enableSortable","spanEl","document","createElement","dragDrop","disableIEFix","parent","parentElement","_disableSortable","_reloadSortable","_index","children","_attached","parentNode","_html2element","html","tagName","innerHTML","firstChild","_before","target","insertBefore","_after","nextElementSibling","_detach","removeChild","_makeEvent","name","detail","e","createEvent","initEvent","_dispatchEventOnConnected","forEach","dispatchEvent","_serialize","list","sortableElements","options","method","String","connectWith","placeholder","placeholderClass","draggingClass","hoverClass","debounce","maxItems","option","getChildren","Element","test","index","startParent","startList","classList","add","split","getAttribute","id","remove","stopImmediatePropagation","getComputedStyle","height","item","startparent","newParent","style","display","oldDisplay","oldindex","elementIndex","oldElementIndex","endparent","newEndList","newStartList","oldStartList","visiblePlaceholder","preventDefault","stopPropagation","filter","debouncedDragOverEnter","thisHeight","placeholderIndex","thisIndex","forcePlaceholderSize","deadZone","offsetTop","appendChild","onDragOverEnter","dropEffect","destroy","enable","disable"],"mappings":"CAAE,SAASA,EAAMC,GACO,kBAAXC,SAAyBA,OAAOC,IACzCD,UAAWD,GACiB,gBAAZG,SAChBC,OAAOD,QAAUH,IAEjBD,EAAKM,SAAWL,KAElBM,KAAM,WAYR,YA4aA,SAASC,GAAWC,EAAIC,EAAOC,GAC7B,GAAIC,GAAQ,IAEZ,OAAc,KAAVF,EACKD,EAEF,WACL,GAAII,GAAWF,GAAWJ,KACtBO,EAAOC,SACXC,cAAaJ,GACbA,EAAQK,WAAW,WACjBR,EAAGS,MAAML,EAAUC,IAClBJ,IApbP,GAAIS,GACAC,EACAC,KACAC,KAQAC,EAAQ,SAAUC,EAASC,EAAKC,GAClC,MAAcC,UAAVD,EACKF,GAAWA,EAAQI,KAAOJ,EAAQI,IAAIC,MAAQL,EAAQI,IAAIC,KAAKJ,IAEtED,EAAQI,IAAMJ,EAAQI,QACtBJ,EAAQI,IAAIC,KAAOL,EAAQI,IAAIC,SAC/BL,EAAQI,IAAIC,KAAKJ,GAAOC,EAFxBF,SASAM,EAAc,SAAUN,GACtBA,EAAQI,WACHJ,GAAQI,IAAIC,MAUnBE,EAAW,SAAUC,EAAIC,GAC3B,OAAQD,EAAGE,SAAWF,EAAGG,iBAAmBH,EAAGI,mBAAqBJ,EAAGK,oBAAsBL,EAAGM,uBAAyBN,EAAGO,kBAAkBC,KAAKR,EAAIC,IAQrJQ,EAAU,SAAUC,EAAOC,GAC7B,IAAKA,EACH,MAAOC,OAAMC,UAAUC,MAAMN,KAAKE,EAGpC,KAAK,GADDK,MACKC,EAAI,EAAGA,EAAIN,EAAMO,SAAUD,EACZ,gBAAXL,IAAuBZ,EAASW,EAAMM,GAAIL,IACnDI,EAAOG,KAAKR,EAAMM,IAEhBL,EAAOQ,QAAQT,EAAMM,UACvBD,EAAOG,KAAKR,EAAMM,GA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,EAAQ8D,EAAaF,GAAkB9E,EAAM8E,EAAiB,UAAUpD,QAAUsG,IAGlGlB,EAAEiD,iBACFjD,EAAEkD,kBACFlD,EAAExD,aAAaqH,WAAa,OAC5BT,EAAuBlL,KAAM8H,EAAE9C,SAGjCnC,GAAIqB,EAAM0B,OAAOE,GAAkB,WAAY4F,GAC/C7I,EAAIqB,EAAM0B,OAAOE,GAAkB,YAAa4F,KAG3CpD,EAgBT,OAbAvI,GAAS6L,QAAU,SAAU9F,GAC3BD,EAAiBC,IAGnB/F,EAAS8L,OAAS,SAAU/F,GAC1BG,EAAgBH,IAGlB/F,EAAS+L,QAAU,SAAUhG,GAC3BW,EAAiBX,IAIZ/F","file":"html.sortable.min.js","sourcesContent":[";(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.sortable = factory();\n }\n}(this, function() {\n/*\n * HTML5 Sortable library\n * https://github.com/voidberg/html5sortable\n *\n * Original code copyright 2012 Ali Farhadi.\n * This version is mantained by Lukas Oppermann \n * Previously also mantained by Alexandru Badiu \n * jQuery-independent implementation by Nazar Mokrynskyi \n *\n * Released under the MIT license.\n */\n'use strict'\n/*\n * variables global to the plugin\n */\nvar dragging\nvar draggingHeight\nvar placeholders = []\nvar sortables = []\n/**\n * Get or set data on element\n * @param {Element} element\n * @param {string} key\n * @param {*} value\n * @return {*}\n */\nvar _data = function (element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key]\n } else {\n element.h5s = element.h5s || {}\n element.h5s.data = element.h5s.data || {}\n element.h5s.data[key] = value\n }\n}\n/**\n * Remove data from element\n * @param {Element} element\n */\nvar _removeData = function (element) {\n if (element.h5s) {\n delete element.h5s.data\n }\n}\n/**\n * Tests if an element matches a given selector. Comparable to jQuery's $(el).is('.my-class')\n * @param {el} DOM element\n * @param {selector} selector test against the element\n * @returns {boolean}\n */\n/* istanbul ignore next */\nvar _matches = function (el, selector) {\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\n}\n/**\n * Filter only wanted nodes\n * @param {Array|NodeList} nodes\n * @param {Array/string} wanted\n * @returns {Array}\n */\nvar _filter = function (nodes, wanted) {\n if (!wanted) {\n return Array.prototype.slice.call(nodes)\n }\n var result = []\n for (var i = 0; i < nodes.length; ++i) {\n if (typeof wanted === 'string' && _matches(nodes[i], wanted)) {\n result.push(nodes[i])\n }\n if (wanted.indexOf(nodes[i]) !== -1) {\n result.push(nodes[i])\n }\n }\n return result\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n * @param {Function} callback\n */\nvar _on = function (element, event, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _on(element[i], event, callback)\n }\n return\n }\n element.addEventListener(event, callback)\n element.h5s = element.h5s || {}\n element.h5s.events = element.h5s.events || {}\n element.h5s.events[event] = callback\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n */\nvar _off = function (element, event) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _off(element[i], event)\n }\n return\n }\n if (element.h5s && element.h5s.events && element.h5s.events[event]) {\n element.removeEventListener(event, element.h5s.events[event])\n delete element.h5s.events[event]\n }\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n * @param {*} value\n */\nvar _attr = function (element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _attr(element[i], attribute, value)\n }\n return\n }\n element.setAttribute(attribute, value)\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n */\nvar _removeAttr = function (element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _removeAttr(element[i], attribute)\n }\n return\n }\n element.removeAttribute(attribute)\n}\n/**\n * @param {Element} element\n * @returns {{left: *, top: *}}\n */\nvar _offset = function (element) {\n var rect = element.getClientRects()[0]\n return {\n left: rect.left + window.scrollX,\n top: rect.top + window.scrollY\n }\n}\n/*\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n _off(items, 'dragstart')\n _off(items, 'dragend')\n _off(items, 'selectstart')\n _off(items, 'dragover')\n _off(items, 'dragenter')\n _off(items, 'drop')\n}\n/*\n * Remove event handlers from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableEvents = function (sortable) {\n _off(sortable, 'dragover')\n _off(sortable, 'dragenter')\n _off(sortable, 'drop')\n}\n/*\n * Attach ghost to dataTransfer object\n * @param {Event} original event\n * @param {object} ghost-object with item, x and y coordinates\n */\nvar _attachGhost = function (event, ghost) {\n // this needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'move'\n event.dataTransfer.setData('text', '')\n\n // check if setDragImage method is available\n if (event.dataTransfer.setDragImage) {\n event.dataTransfer.setDragImage(ghost.draggedItem, ghost.x, ghost.y)\n }\n}\n/**\n * _addGhostPos clones the dragged item and adds it as a Ghost item\n * @param {Event} event - the event fired when dragstart is triggered\n * @param {object} ghost - .draggedItem = Element\n */\nvar _addGhostPos = function (event, ghost) {\n if (!ghost.x) {\n ghost.x = parseInt(event.pageX - _offset(ghost.draggedItem).left)\n }\n if (!ghost.y) {\n ghost.y = parseInt(event.pageY - _offset(ghost.draggedItem).top)\n }\n return ghost\n}\n/**\n * _makeGhost decides which way to make a ghost and passes it to attachGhost\n * @param {Element} draggedItem - the item that the user drags\n */\nvar _makeGhost = function (draggedItem) {\n return {\n draggedItem: draggedItem\n }\n}\n/**\n * _getGhost constructs ghost and attaches it to dataTransfer\n * @param {Event} event - the original drag event object\n * @param {Element} draggedItem - the item that the user drags\n */\n// TODO: could draggedItem be replaced by event.target in all instances\nvar _getGhost = function (event, draggedItem) {\n // add ghost item & draggedItem to ghost object\n var ghost = _makeGhost(draggedItem)\n // attach ghost position\n ghost = _addGhostPos(event, ghost)\n // attach ghost to dataTransfer\n _attachGhost(event, ghost)\n}\n/*\n * Remove data from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n _removeData(sortable)\n _removeAttr(sortable, 'aria-dropeffect')\n}\n/*\n * Remove data from items\n * @param {Array|Element} items\n */\nvar _removeItemData = function (items) {\n _removeAttr(items, 'aria-grabbed')\n _removeAttr(items, 'draggable')\n _removeAttr(items, 'role')\n}\n/*\n * Check if two lists are connected\n * @param {Element} curList\n * @param {Element} destList\n */\nvar _listsConnected = function (curList, destList) {\n if (curList === destList) {\n return true\n }\n if (_data(curList, 'connectWith') !== undefined) {\n return _data(curList, 'connectWith') === _data(destList, 'connectWith')\n }\n return false\n}\n/*\n * get handle or return item\n * @param {Array} items\n * @param {selector} handle\n */\nvar _getHandles = function (items, handle) {\n var result = []\n var handles\n if (!handle) {\n return items\n }\n for (var i = 0; i < items.length; ++i) {\n handles = items[i].querySelectorAll(handle)\n result = result.concat(Array.prototype.slice.call(handles))\n }\n return result\n}\n/*\n * Destroy the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts') || {}\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n // remove event handlers & data from sortable\n _removeSortableEvents(sortableElement)\n _removeSortableData(sortableElement)\n // remove event handlers & data from items\n _off(handles, 'mousedown')\n _removeItemEvents(items)\n _removeItemData(items)\n}\n/*\n * Enable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'move')\n _data(sortableElement, '_disabled', 'false')\n _attr(handles, 'draggable', 'true')\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n var spanEl = (document || window.document).createElement('span')\n if (typeof spanEl.dragDrop === 'function' && !opts.disableIEFix) {\n _on(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop()\n } else {\n var parent = this.parentElement\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement\n }\n parent.dragDrop()\n }\n })\n }\n}\n/*\n * Disable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'none')\n _data(sortableElement, '_disabled', 'true')\n _attr(handles, 'draggable', 'false')\n _off(handles, 'mousedown')\n}\n/*\n * Reload the sortable\n * @param {Element} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _data(sortableElement, '_disabled', 'false')\n // remove event handlers from items\n _removeItemEvents(items)\n _off(handles, 'mousedown')\n // remove event handlers from sortable\n _removeSortableEvents(sortableElement)\n}\n/**\n * Get position of the element relatively to its sibling elements\n * @param {Element} element\n * @returns {number}\n */\nvar _index = function (element) {\n if (!element.parentElement) {\n return 0\n }\n return Array.prototype.indexOf.call(element.parentElement.children, element)\n}\n/**\n * Whether element is in DOM\n * @param {Element} element\n * @returns {boolean}\n */\nvar _attached = function (element) {\n // document.body.contains(element)\n return !!element.parentNode\n}\n/**\n * Convert HTML string into DOM element.\n * @param {Element|string} html\n * @param {string} tagname\n * @returns {Element}\n */\nvar _html2element = function (html, tagName) {\n if (typeof html !== 'string') {\n return html\n }\n var parentElement = document.createElement(tagName)\n parentElement.innerHTML = html\n return parentElement.firstChild\n}\n/**\n * Insert before target\n * @param {Element} target\n * @param {Element} element\n */\nvar _before = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target\n )\n}\n/**\n * Insert after target\n * @param {Element} target\n * @param {Element} element\n */\nvar _after = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target.nextElementSibling\n )\n}\n/**\n * Detach element from DOM\n * @param {Element} element\n */\nvar _detach = function (element) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n }\n}\n/**\n * Make native event that can be dispatched afterwards\n * @param {string} name\n * @param {object} detail\n * @returns {CustomEvent}\n */\nvar _makeEvent = function (name, detail) {\n var e = document.createEvent('Event')\n if (detail) {\n e.detail = detail\n }\n e.initEvent(name, false, true)\n return e\n}\n/**\n * @param {Element} sortableElement\n * @param {CustomEvent} event\n */\nvar _dispatchEventOnConnected = function (sortableElement, event) {\n sortables.forEach(function (target) {\n if (_listsConnected(sortableElement, target)) {\n target.dispatchEvent(event)\n }\n })\n}\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {fn} Function to debounce\n * @param {delay} time to wait before calling function with latest arguments, 0 - no debounce\n * @param {context} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nfunction _debounce (fn, delay, context) {\n var timer = null\n\n if (delay === 0) {\n return fn\n }\n return function () {\n var eContext = context || this\n var args = arguments\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(eContext, args)\n }, delay)\n }\n}\n\nvar _getChildren = function (element) {\n return element.children\n}\n\nvar _serialize = function (list) {\n var children = _filter(_getChildren(list), _data(list, 'items'))\n return children\n}\n\n/*\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nvar sortable = function (sortableElements, options) {\n var method = String(options)\n\n options = (function (options) {\n var result = {\n connectWith: false,\n placeholder: null,\n disableIEFix: false,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n debounce: 0,\n maxItems: 0\n }\n for (var option in options) {\n result[option] = options[option]\n }\n return result\n })(options)\n\n if (options && typeof options.getChildren === 'function') {\n _getChildren = options.getChildren\n }\n\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements)\n }\n\n if (sortableElements instanceof window.Element) {\n sortableElements = [sortableElements]\n }\n\n sortableElements = Array.prototype.slice.call(sortableElements)\n\n /* TODO: maxstatements should be 25, fix and remove line below */\n /* jshint maxstatements:false */\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n sortable[method](sortableElement)\n return\n }\n\n // get options & set options on sortable\n options = _data(sortableElement, 'opts') || options\n _data(sortableElement, 'opts', options)\n // reset sortable\n _reloadSortable(sortableElement)\n // initialize\n var items = _filter(_getChildren(sortableElement), options.items)\n var index\n var startParent\n var startList\n var placeholder = options.placeholder\n var maxItems\n if (!placeholder) {\n placeholder = document.createElement(\n /^ul|ol$/i.test(sortableElement.tagName) ? 'li' : 'div'\n )\n }\n placeholder = _html2element(placeholder, sortableElement.tagName)\n placeholder.classList.add.apply(\n placeholder.classList,\n options.placeholderClass.split(' ')\n )\n\n // setup sortable ids\n if (!sortableElement.getAttribute('data-sortable-id')) {\n var id = sortables.length\n sortables[id] = sortableElement\n _attr(sortableElement, 'data-sortable-id', id)\n _attr(items, 'data-item-sortable-id', id)\n }\n\n _data(sortableElement, 'items', options.items)\n placeholders.push(placeholder)\n if (options.connectWith) {\n _data(sortableElement, 'connectWith', options.connectWith)\n }\n\n _enableSortable(sortableElement)\n _attr(items, 'role', 'option')\n _attr(items, 'aria-grabbed', 'false')\n\n // Mouse over class\n if (options.hoverClass) {\n var hoverClass = 'sortable-over'\n if (typeof options.hoverClass === 'string') {\n hoverClass = options.hoverClass\n }\n\n _on(items, 'mouseenter', function () {\n this.classList.add(hoverClass)\n })\n _on(items, 'mouseleave', function () {\n this.classList.remove(hoverClass)\n })\n }\n\n // max items\n if (options.maxItems && typeof options.maxItems === 'number') {\n maxItems = options.maxItems\n }\n\n // Handle drag events on draggable items\n _on(items, 'dragstart', function (e) {\n e.stopImmediatePropagation()\n if ((options.handle && !_matches(e.target, options.handle)) || this.getAttribute('draggable') === 'false') {\n return\n }\n\n // add transparent clone or other ghost to cursor\n _getGhost(e, this)\n // cache selsection & add attr for dragging\n this.classList.add(options.draggingClass)\n dragging = this\n _attr(dragging, 'aria-grabbed', 'true')\n // grab values\n index = _index(dragging)\n draggingHeight = parseInt(window.getComputedStyle(dragging).height)\n startParent = this.parentElement\n startList = _serialize(startParent)\n // dispatch sortstart event on each element in group\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstart', {\n item: dragging,\n placeholder: placeholder,\n startparent: startParent\n }))\n })\n // Handle drag events on draggable items\n _on(items, 'dragend', function () {\n var newParent\n if (!dragging) {\n return\n }\n // remove dragging attributes and show item\n dragging.classList.remove(options.draggingClass)\n _attr(dragging, 'aria-grabbed', 'false')\n dragging.style.display = dragging.oldDisplay\n delete dragging.oldDisplay\n\n placeholders.forEach(_detach)\n newParent = this.parentElement\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstop', {\n item: dragging,\n startparent: startParent\n }))\n if (index !== _index(dragging) || startParent !== newParent) {\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortupdate', {\n item: dragging,\n index: _filter(_getChildren(newParent), _data(newParent, 'items'))\n .indexOf(dragging),\n oldindex: items.indexOf(dragging),\n elementIndex: _index(dragging),\n oldElementIndex: index,\n startparent: startParent,\n endparent: newParent,\n newEndList: _serialize(newParent),\n newStartList: _serialize(startParent),\n oldStartList: startList\n }))\n }\n dragging = null\n draggingHeight = null\n })\n // Handle drop event on sortable & placeholder\n // TODO: REMOVE placeholder?????\n _on([sortableElement, placeholder], 'drop', function (e) {\n var visiblePlaceholder\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return\n }\n\n e.preventDefault()\n e.stopPropagation()\n visiblePlaceholder = placeholders.filter(_attached)[0]\n _after(visiblePlaceholder, dragging)\n dragging.dispatchEvent(_makeEvent('dragend'))\n })\n\n var debouncedDragOverEnter = _debounce(function (element, pageY) {\n if (!dragging) {\n return\n }\n\n if (items.indexOf(element) !== -1) {\n var thisHeight = parseInt(window.getComputedStyle(element).height)\n var placeholderIndex = _index(placeholder)\n var thisIndex = _index(element)\n if (options.forcePlaceholderSize) {\n placeholder.style.height = draggingHeight + 'px'\n }\n\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight) {\n // Dead zone?\n var deadZone = thisHeight - draggingHeight\n var offsetTop = _offset(element).top\n if (placeholderIndex < thisIndex &&\n pageY < offsetTop + deadZone) {\n return\n }\n if (placeholderIndex > thisIndex &&\n pageY > offsetTop + thisHeight - deadZone) {\n return\n }\n }\n\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display\n }\n\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none'\n }\n\n if (placeholderIndex < thisIndex) {\n _after(element, placeholder)\n } else {\n _before(element, placeholder)\n }\n // Intentionally violated chaining, it is more complex otherwise\n placeholders\n .filter(function (element) { return element !== placeholder })\n .forEach(_detach)\n } else {\n if (placeholders.indexOf(element) === -1 &&\n !_filter(_getChildren(element), options.items).length) {\n placeholders.forEach(_detach)\n element.appendChild(placeholder)\n }\n }\n }, options.debounce)\n\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || _data(sortableElement, '_disabled') === 'true') {\n return\n }\n if (maxItems && _filter(_getChildren(sortableElement), _data(sortableElement, 'items')).length >= maxItems) {\n return\n }\n e.preventDefault()\n e.stopPropagation()\n e.dataTransfer.dropEffect = 'move'\n debouncedDragOverEnter(this, e.pageY)\n }\n\n _on(items.concat(sortableElement), 'dragover', onDragOverEnter)\n _on(items.concat(sortableElement), 'dragenter', onDragOverEnter)\n })\n\n return sortableElements\n}\n\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement)\n}\n\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement)\n}\n\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement)\n}\n\n\nreturn sortable;\n}));\n"]}
\ No newline at end of file
+{"version":3,"sources":["html.sortable.min.js"],"names":["root","factory","define","amd","exports","module","sortable","this","_debounce","fn","delay","context","timer","eContext","args","arguments","clearTimeout","setTimeout","apply","dragging","draggingHeight","placeholders","sortables","_data","element","key","value","undefined","h5s","data","_removeData","_matches","el","selector","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","call","_filter","nodes","wanted","Array","prototype","slice","result","i","length","push","indexOf","_on","event","callback","addEventListener","events","_off","removeEventListener","_attr","attribute","setAttribute","_removeAttr","removeAttribute","_offset","rect","getClientRects","left","window","scrollX","top","scrollY","_removeItemEvents","items","_removeSortableEvents","_attachGhost","ghost","dataTransfer","effectAllowed","setData","setDragImage","draggedItem","x","y","_addGhostPos","parseInt","pageX","pageY","_makeGhost","_getGhost","_removeSortableData","_removeItemData","_listsConnected","curList","destList","_getHandles","handle","handles","querySelectorAll","concat","_destroySortable","sortableElement","opts","_getChildren","_enableSortable","spanEl","document","createElement","dragDrop","disableIEFix","parent","parentElement","_disableSortable","_reloadSortable","_index","children","_attached","parentNode","_html2element","html","tagName","innerHTML","firstChild","_before","target","insertBefore","_after","nextElementSibling","_detach","removeChild","_makeEvent","name","detail","e","createEvent","initEvent","_dispatchEventOnConnected","forEach","dispatchEvent","_serialize","list","sortableElements","options","method","String","connectWith","placeholder","placeholderClass","draggingClass","hoverClass","debounce","maxItems","option","getChildren","Element","test","serialized","index","startParent","startList","classList","add","split","getAttribute","id","remove","stopImmediatePropagation","getComputedStyle","height","item","startparent","newParent","style","display","oldDisplay","oldindex","elementIndex","oldElementIndex","endparent","newEndList","newStartList","oldStartList","visiblePlaceholder","preventDefault","stopPropagation","filter","debouncedDragOverEnter","thisHeight","placeholderIndex","thisIndex","forcePlaceholderSize","deadZone","offsetTop","appendChild","onDragOverEnter","dropEffect","destroy","enable","disable"],"mappings":"CAAE,SAASA,EAAMC,GACO,kBAAXC,SAAyBA,OAAOC,IACzCD,UAAWD,GACiB,gBAAZG,SAChBC,OAAOD,QAAUH,IAEjBD,EAAKM,SAAWL,KAElBM,KAAM,WAYR,YA4aA,S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aAAasH,WAAa,OAC5BT,EAAuBnL,KAAM8H,EAAE9C,SAGjCnC,GAAIqB,EAAM0B,OAAOE,GAAkB,WAAY6F,GAC/C9I,EAAIqB,EAAM0B,OAAOE,GAAkB,YAAa6F,KAG3CrD,EAgBT,OAbAvI,GAAS8L,QAAU,SAAU/F,GAC3BD,EAAiBC,IAGnB/F,EAAS+L,OAAS,SAAUhG,GAC1BG,EAAgBH,IAGlB/F,EAASgM,QAAU,SAAUjG,GAC3BW,EAAiBX,IAIZ/F","file":"html.sortable.min.js","sourcesContent":[";(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.sortable = factory();\n }\n}(this, function() {\n/*\n * HTML5 Sortable library\n * https://github.com/voidberg/html5sortable\n *\n * Original code copyright 2012 Ali Farhadi.\n * This version is mantained by Lukas Oppermann \n * Previously also mantained by Alexandru Badiu \n * jQuery-independent implementation by Nazar Mokrynskyi \n *\n * Released under the MIT license.\n */\n'use strict'\n/*\n * variables global to the plugin\n */\nvar dragging\nvar draggingHeight\nvar placeholders = []\nvar sortables = []\n/**\n * Get or set data on element\n * @param {Element} element\n * @param {string} key\n * @param {*} value\n * @return {*}\n */\nvar _data = function (element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key]\n } else {\n element.h5s = element.h5s || {}\n element.h5s.data = element.h5s.data || {}\n element.h5s.data[key] = value\n }\n}\n/**\n * Remove data from element\n * @param {Element} element\n */\nvar _removeData = function (element) {\n if (element.h5s) {\n delete element.h5s.data\n }\n}\n/**\n * Tests if an element matches a given selector. Comparable to jQuery's $(el).is('.my-class')\n * @param {el} DOM element\n * @param {selector} selector test against the element\n * @returns {boolean}\n */\n/* istanbul ignore next */\nvar _matches = function (el, selector) {\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\n}\n/**\n * Filter only wanted nodes\n * @param {Array|NodeList} nodes\n * @param {Array/string} wanted\n * @returns {Array}\n */\nvar _filter = function (nodes, wanted) {\n if (!wanted) {\n return Array.prototype.slice.call(nodes)\n }\n var result = []\n for (var i = 0; i < nodes.length; ++i) {\n if (typeof wanted === 'string' && _matches(nodes[i], wanted)) {\n result.push(nodes[i])\n }\n if (wanted.indexOf(nodes[i]) !== -1) {\n result.push(nodes[i])\n }\n }\n return result\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n * @param {Function} callback\n */\nvar _on = function (element, event, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _on(element[i], event, callback)\n }\n return\n }\n element.addEventListener(event, callback)\n element.h5s = element.h5s || {}\n element.h5s.events = element.h5s.events || {}\n element.h5s.events[event] = callback\n}\n/**\n * @param {Array|Element} element\n * @param {Array|string} event\n */\nvar _off = function (element, event) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _off(element[i], event)\n }\n return\n }\n if (element.h5s && element.h5s.events && element.h5s.events[event]) {\n element.removeEventListener(event, element.h5s.events[event])\n delete element.h5s.events[event]\n }\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n * @param {*} value\n */\nvar _attr = function (element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _attr(element[i], attribute, value)\n }\n return\n }\n element.setAttribute(attribute, value)\n}\n/**\n * @param {Array|Element} element\n * @param {string} attribute\n */\nvar _removeAttr = function (element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n _removeAttr(element[i], attribute)\n }\n return\n }\n element.removeAttribute(attribute)\n}\n/**\n * @param {Element} element\n * @returns {{left: *, top: *}}\n */\nvar _offset = function (element) {\n var rect = element.getClientRects()[0]\n return {\n left: rect.left + window.scrollX,\n top: rect.top + window.scrollY\n }\n}\n/*\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n _off(items, 'dragstart')\n _off(items, 'dragend')\n _off(items, 'selectstart')\n _off(items, 'dragover')\n _off(items, 'dragenter')\n _off(items, 'drop')\n}\n/*\n * Remove event handlers from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableEvents = function (sortable) {\n _off(sortable, 'dragover')\n _off(sortable, 'dragenter')\n _off(sortable, 'drop')\n}\n/*\n * Attach ghost to dataTransfer object\n * @param {Event} original event\n * @param {object} ghost-object with item, x and y coordinates\n */\nvar _attachGhost = function (event, ghost) {\n // this needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'move'\n event.dataTransfer.setData('text', '')\n\n // check if setDragImage method is available\n if (event.dataTransfer.setDragImage) {\n event.dataTransfer.setDragImage(ghost.draggedItem, ghost.x, ghost.y)\n }\n}\n/**\n * _addGhostPos clones the dragged item and adds it as a Ghost item\n * @param {Event} event - the event fired when dragstart is triggered\n * @param {object} ghost - .draggedItem = Element\n */\nvar _addGhostPos = function (event, ghost) {\n if (!ghost.x) {\n ghost.x = parseInt(event.pageX - _offset(ghost.draggedItem).left)\n }\n if (!ghost.y) {\n ghost.y = parseInt(event.pageY - _offset(ghost.draggedItem).top)\n }\n return ghost\n}\n/**\n * _makeGhost decides which way to make a ghost and passes it to attachGhost\n * @param {Element} draggedItem - the item that the user drags\n */\nvar _makeGhost = function (draggedItem) {\n return {\n draggedItem: draggedItem\n }\n}\n/**\n * _getGhost constructs ghost and attaches it to dataTransfer\n * @param {Event} event - the original drag event object\n * @param {Element} draggedItem - the item that the user drags\n */\n// TODO: could draggedItem be replaced by event.target in all instances\nvar _getGhost = function (event, draggedItem) {\n // add ghost item & draggedItem to ghost object\n var ghost = _makeGhost(draggedItem)\n // attach ghost position\n ghost = _addGhostPos(event, ghost)\n // attach ghost to dataTransfer\n _attachGhost(event, ghost)\n}\n/*\n * Remove data from sortable\n * @param {Element} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n _removeData(sortable)\n _removeAttr(sortable, 'aria-dropeffect')\n}\n/*\n * Remove data from items\n * @param {Array|Element} items\n */\nvar _removeItemData = function (items) {\n _removeAttr(items, 'aria-grabbed')\n _removeAttr(items, 'draggable')\n _removeAttr(items, 'role')\n}\n/*\n * Check if two lists are connected\n * @param {Element} curList\n * @param {Element} destList\n */\nvar _listsConnected = function (curList, destList) {\n if (curList === destList) {\n return true\n }\n if (_data(curList, 'connectWith') !== undefined) {\n return _data(curList, 'connectWith') === _data(destList, 'connectWith')\n }\n return false\n}\n/*\n * get handle or return item\n * @param {Array} items\n * @param {selector} handle\n */\nvar _getHandles = function (items, handle) {\n var result = []\n var handles\n if (!handle) {\n return items\n }\n for (var i = 0; i < items.length; ++i) {\n handles = items[i].querySelectorAll(handle)\n result = result.concat(Array.prototype.slice.call(handles))\n }\n return result\n}\n/*\n * Destroy the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts') || {}\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n // remove event handlers & data from sortable\n _removeSortableEvents(sortableElement)\n _removeSortableData(sortableElement)\n // remove event handlers & data from items\n _off(handles, 'mousedown')\n _removeItemEvents(items)\n _removeItemData(items)\n}\n/*\n * Enable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'move')\n _data(sortableElement, '_disabled', 'false')\n _attr(handles, 'draggable', 'true')\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n var spanEl = (document || window.document).createElement('span')\n if (typeof spanEl.dragDrop === 'function' && !opts.disableIEFix) {\n _on(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop()\n } else {\n var parent = this.parentElement\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement\n }\n parent.dragDrop()\n }\n })\n }\n}\n/*\n * Disable the sortable\n * @param {Element} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _attr(sortableElement, 'aria-dropeffect', 'none')\n _data(sortableElement, '_disabled', 'true')\n _attr(handles, 'draggable', 'false')\n _off(handles, 'mousedown')\n}\n/*\n * Reload the sortable\n * @param {Element} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = _data(sortableElement, 'opts')\n var items = _filter(_getChildren(sortableElement), opts.items)\n var handles = _getHandles(items, opts.handle)\n _data(sortableElement, '_disabled', 'false')\n // remove event handlers from items\n _removeItemEvents(items)\n _off(handles, 'mousedown')\n // remove event handlers from sortable\n _removeSortableEvents(sortableElement)\n}\n/**\n * Get position of the element relatively to its sibling elements\n * @param {Element} element\n * @returns {number}\n */\nvar _index = function (element) {\n if (!element.parentElement) {\n return 0\n }\n return Array.prototype.indexOf.call(element.parentElement.children, element)\n}\n/**\n * Whether element is in DOM\n * @param {Element} element\n * @returns {boolean}\n */\nvar _attached = function (element) {\n // document.body.contains(element)\n return !!element.parentNode\n}\n/**\n * Convert HTML string into DOM element.\n * @param {Element|string} html\n * @param {string} tagname\n * @returns {Element}\n */\nvar _html2element = function (html, tagName) {\n if (typeof html !== 'string') {\n return html\n }\n var parentElement = document.createElement(tagName)\n parentElement.innerHTML = html\n return parentElement.firstChild\n}\n/**\n * Insert before target\n * @param {Element} target\n * @param {Element} element\n */\nvar _before = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target\n )\n}\n/**\n * Insert after target\n * @param {Element} target\n * @param {Element} element\n */\nvar _after = function (target, element) {\n target.parentElement.insertBefore(\n element,\n target.nextElementSibling\n )\n}\n/**\n * Detach element from DOM\n * @param {Element} element\n */\nvar _detach = function (element) {\n if (element.parentNode) {\n element.parentNode.removeChild(element)\n }\n}\n/**\n * Make native event that can be dispatched afterwards\n * @param {string} name\n * @param {object} detail\n * @returns {CustomEvent}\n */\nvar _makeEvent = function (name, detail) {\n var e = document.createEvent('Event')\n if (detail) {\n e.detail = detail\n }\n e.initEvent(name, false, true)\n return e\n}\n/**\n * @param {Element} sortableElement\n * @param {CustomEvent} event\n */\nvar _dispatchEventOnConnected = function (sortableElement, event) {\n sortables.forEach(function (target) {\n if (_listsConnected(sortableElement, target)) {\n target.dispatchEvent(event)\n }\n })\n}\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {fn} Function to debounce\n * @param {delay} time to wait before calling function with latest arguments, 0 - no debounce\n * @param {context} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nfunction _debounce (fn, delay, context) {\n var timer = null\n\n if (delay === 0) {\n return fn\n }\n return function () {\n var eContext = context || this\n var args = arguments\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(eContext, args)\n }, delay)\n }\n}\n\nvar _getChildren = function (element) {\n return element.children\n}\n\nvar _serialize = function (list) {\n var children = _filter(_getChildren(list), _data(list, 'items'))\n return children\n}\n\n/*\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nvar sortable = function (sortableElements, options) {\n var method = String(options)\n\n options = (function (options) {\n var result = {\n connectWith: false,\n placeholder: null,\n disableIEFix: false,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n debounce: 0,\n maxItems: 0\n }\n for (var option in options) {\n result[option] = options[option]\n }\n return result\n })(options)\n\n if (options && typeof options.getChildren === 'function') {\n _getChildren = options.getChildren\n }\n\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements)\n }\n\n if (sortableElements instanceof window.Element) {\n sortableElements = [sortableElements]\n }\n\n sortableElements = Array.prototype.slice.call(sortableElements)\n\n if (/serialize/.test(method)) {\n var serialized = []\n sortableElements.forEach(function (sortableElement) {\n serialized.push({\n list: sortableElement,\n children: _serialize(sortableElement)\n })\n })\n return serialized\n }\n\n /* TODO: maxstatements should be 25, fix and remove line below */\n /* jshint maxstatements:false */\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement)\n }\n\n // get options & set options on sortable\n options = _data(sortableElement, 'opts') || options\n _data(sortableElement, 'opts', options)\n // reset sortable\n _reloadSortable(sortableElement)\n // initialize\n var items = _filter(_getChildren(sortableElement), options.items)\n var index\n var startParent\n var startList\n var placeholder = options.placeholder\n var maxItems\n if (!placeholder) {\n placeholder = document.createElement(\n /^ul|ol$/i.test(sortableElement.tagName) ? 'li' : 'div'\n )\n }\n placeholder = _html2element(placeholder, sortableElement.tagName)\n placeholder.classList.add.apply(\n placeholder.classList,\n options.placeholderClass.split(' ')\n )\n\n // setup sortable ids\n if (!sortableElement.getAttribute('data-sortable-id')) {\n var id = sortables.length\n sortables[id] = sortableElement\n _attr(sortableElement, 'data-sortable-id', id)\n _attr(items, 'data-item-sortable-id', id)\n }\n\n _data(sortableElement, 'items', options.items)\n placeholders.push(placeholder)\n if (options.connectWith) {\n _data(sortableElement, 'connectWith', options.connectWith)\n }\n\n _enableSortable(sortableElement)\n _attr(items, 'role', 'option')\n _attr(items, 'aria-grabbed', 'false')\n\n // Mouse over class\n if (options.hoverClass) {\n var hoverClass = 'sortable-over'\n if (typeof options.hoverClass === 'string') {\n hoverClass = options.hoverClass\n }\n\n _on(items, 'mouseenter', function () {\n this.classList.add(hoverClass)\n })\n _on(items, 'mouseleave', function () {\n this.classList.remove(hoverClass)\n })\n }\n\n // max items\n if (options.maxItems && typeof options.maxItems === 'number') {\n maxItems = options.maxItems\n }\n\n // Handle drag events on draggable items\n _on(items, 'dragstart', function (e) {\n e.stopImmediatePropagation()\n if ((options.handle && !_matches(e.target, options.handle)) || this.getAttribute('draggable') === 'false') {\n return\n }\n\n // add transparent clone or other ghost to cursor\n _getGhost(e, this)\n // cache selsection & add attr for dragging\n this.classList.add(options.draggingClass)\n dragging = this\n _attr(dragging, 'aria-grabbed', 'true')\n // grab values\n index = _index(dragging)\n draggingHeight = parseInt(window.getComputedStyle(dragging).height)\n startParent = this.parentElement\n startList = _serialize(startParent)\n // dispatch sortstart event on each element in group\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstart', {\n item: dragging,\n placeholder: placeholder,\n startparent: startParent\n }))\n })\n // Handle drag events on draggable items\n _on(items, 'dragend', function () {\n var newParent\n if (!dragging) {\n return\n }\n // remove dragging attributes and show item\n dragging.classList.remove(options.draggingClass)\n _attr(dragging, 'aria-grabbed', 'false')\n dragging.style.display = dragging.oldDisplay\n delete dragging.oldDisplay\n\n placeholders.forEach(_detach)\n newParent = this.parentElement\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortstop', {\n item: dragging,\n startparent: startParent\n }))\n if (index !== _index(dragging) || startParent !== newParent) {\n _dispatchEventOnConnected(sortableElement, _makeEvent('sortupdate', {\n item: dragging,\n index: _filter(_getChildren(newParent), _data(newParent, 'items'))\n .indexOf(dragging),\n oldindex: items.indexOf(dragging),\n elementIndex: _index(dragging),\n oldElementIndex: index,\n startparent: startParent,\n endparent: newParent,\n newEndList: _serialize(newParent),\n newStartList: _serialize(startParent),\n oldStartList: startList\n }))\n }\n dragging = null\n draggingHeight = null\n })\n // Handle drop event on sortable & placeholder\n // TODO: REMOVE placeholder?????\n _on([sortableElement, placeholder], 'drop', function (e) {\n var visiblePlaceholder\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return\n }\n\n e.preventDefault()\n e.stopPropagation()\n visiblePlaceholder = placeholders.filter(_attached)[0]\n _after(visiblePlaceholder, dragging)\n dragging.dispatchEvent(_makeEvent('dragend'))\n })\n\n var debouncedDragOverEnter = _debounce(function (element, pageY) {\n if (!dragging) {\n return\n }\n\n if (items.indexOf(element) !== -1) {\n var thisHeight = parseInt(window.getComputedStyle(element).height)\n var placeholderIndex = _index(placeholder)\n var thisIndex = _index(element)\n if (options.forcePlaceholderSize) {\n placeholder.style.height = draggingHeight + 'px'\n }\n\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight) {\n // Dead zone?\n var deadZone = thisHeight - draggingHeight\n var offsetTop = _offset(element).top\n if (placeholderIndex < thisIndex &&\n pageY < offsetTop + deadZone) {\n return\n }\n if (placeholderIndex > thisIndex &&\n pageY > offsetTop + thisHeight - deadZone) {\n return\n }\n }\n\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display\n }\n\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none'\n }\n\n if (placeholderIndex < thisIndex) {\n _after(element, placeholder)\n } else {\n _before(element, placeholder)\n }\n // Intentionally violated chaining, it is more complex otherwise\n placeholders\n .filter(function (element) { return element !== placeholder })\n .forEach(_detach)\n } else {\n if (placeholders.indexOf(element) === -1 &&\n !_filter(_getChildren(element), options.items).length) {\n placeholders.forEach(_detach)\n element.appendChild(placeholder)\n }\n }\n }, options.debounce)\n\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || _data(sortableElement, '_disabled') === 'true') {\n return\n }\n if (maxItems && _filter(_getChildren(sortableElement), _data(sortableElement, 'items')).length >= maxItems) {\n return\n }\n e.preventDefault()\n e.stopPropagation()\n e.dataTransfer.dropEffect = 'move'\n debouncedDragOverEnter(this, e.pageY)\n }\n\n _on(items.concat(sortableElement), 'dragover', onDragOverEnter)\n _on(items.concat(sortableElement), 'dragenter', onDragOverEnter)\n })\n\n return sortableElements\n}\n\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement)\n}\n\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement)\n}\n\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement)\n}\n\n\nreturn sortable;\n}));\n"]}
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
index 3f1c5103..aea0ca46 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -5,6 +5,7 @@ var gulp = require('gulp')
var rename = require('gulp-rename')
var uglify = require('gulp-uglify')
var sourcemaps = require('gulp-sourcemaps')
+var pump = require('pump')
var umd = require('gulp-umd')
var strip = require('gulp-strip-code')
@@ -28,17 +29,19 @@ gulp.task('umd', function () {
})
/* ---------- */
/* build */
-gulp.task('minify', ['umd'], function () {
+gulp.task('minify', ['umd'], function (cb) {
// copy files to dist
- gulp.src(['dist/html.sortable.js'])
+ pump([
+ gulp.src(['dist/html.sortable.js'])
.pipe(sourcemaps.init({loadMaps: true}))
- .pipe(uglify())
.pipe(rename({
suffix: '.min'
- }))
- .pipe(sourcemaps.write('./'))
- .pipe(gulp.dest('./dist'))
- .pipe(gulp.dest('./docs'))
+ })),
+ uglify(),
+ sourcemaps.write('./'),
+ gulp.dest('./dist'),
+ gulp.dest('./docs')
+ ],cb)
})
/* ---------- */
/* tasks */
diff --git a/package-lock.json b/package-lock.json
index bf16bedd..a0ad421d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3917,6 +3917,28 @@
"integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=",
"dev": true
},
+ "pump": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz",
+ "integrity": "sha1-Oz7mUS+U8OV1U4wXmV+fFpkKXVE=",
+ "dev": true,
+ "dependencies": {
+ "end-of-stream": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz",
+ "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=",
+ "dev": true,
+ "dependencies": {
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true
+ }
+ }
+ }
+ }
+ },
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
diff --git a/package.json b/package.json
index e7276fd0..501d76eb 100644
--- a/package.json
+++ b/package.json
@@ -28,12 +28,13 @@
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^1.12.0",
"gulp-strip-code": "^0.1.2",
- "gulp-uglify": "^1.2.0",
+ "gulp-uglify": "^3.0.0",
"gulp-umd": "^0.2.1",
"istanbul": "0.4.x",
"jsdom": "10.*",
"mocha": "^3.4.2",
"nyc": "^11.0.0",
+ "pump": "^1.0.2",
"requirejs": "^2.3.*",
"snazzy": "^6.0.0",
"standard": "^10.0.*",
diff --git a/src/html.sortable.js b/src/html.sortable.js
index 71acb235..7ee71f5c 100644
--- a/src/html.sortable.js
+++ b/src/html.sortable.js
@@ -502,7 +502,7 @@ var sortable = function (sortableElements, options) {
sortableElements = Array.prototype.slice.call(sortableElements)
if (/serialize/.test(method)) {
- let serialized = []
+ var serialized = []
sortableElements.forEach(function (sortableElement) {
serialized.push({
list: sortableElement,