Nestable2 Issue
by jasper502
JavaScript
/*!
* Nestable jQuery Plugin - Copyright (c) 2014 Ramon Smit - https://github.com/RamonSmit/Nestable
*/
(function($, window, document, undefined) {
var hasTouch = 'ontouchstart' in document;
/**
* Detect CSS pointer-events property
* events are normally disabled on the dragging element to avoid conflicts
* https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
*/
var hasPointerEvents = (function() {
var el = document.createElement('div'),
docEl = document.documentElement;
if (!('pointerEvents' in el.style)) {
return false;
}
el.style.pointerEvents = 'auto';
el.style.pointerEvents = 'x';
docEl.appendChild(el);
var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';
docEl.removeChild(el);
return !!supports;
})();
var defaults = {
contentCallback: function(item) {return item.content || '' ? item.content : item.id;},
listNodeName: 'ol',
itemNodeName: 'li',
handleNodeName: 'div',
contentNodeName: 'span',
rootClass: 'dd',
listClass: 'dd-list',
itemClass: 'dd-item',
dragClass: 'dd-dragel',
handleClass: 'dd-handle',
contentClass: 'dd-content',
collapsedClass: 'dd-collapsed',
placeClass: 'dd-placeholder',
noDragClass: 'dd-nodrag',
noChildrenClass: 'dd-nochildren',
emptyClass: 'dd-empty',
expandBtnHTML: '<button class="dd-expand" data-action="expand" type="button">Expand</button>',
collapseBtnHTML: '<button class="dd-collapse" data-action="collapse" type="button">Collapse</button>',
group: 0,
maxDepth: 5,
threshold: 20,
fixedDepth: false, //fixed item's depth
fixed: false,
includeContent: false,
scroll: false,
scrollSensitivity: 1,
...