mobius1-selectable
Advanced tools
Comparing version 0.5.4 to 0.5.5
{ | ||
"name": "mobius1-selectable", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"ignore": [ | ||
@@ -5,0 +5,0 @@ ".gitattributes", |
{ | ||
"name": "mobius1-selectable", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "UI Selectable plugin without the bloat of jQuery and jQuery UI.", | ||
@@ -5,0 +5,0 @@ "main": "selectable.min.js", |
@@ -8,3 +8,3 @@ /*! | ||
* | ||
* Version: 0.5.4 | ||
* Version: 0.5.5 | ||
* | ||
@@ -25,2 +25,4 @@ */ | ||
var version = "0.5.5"; | ||
var supports = 'classList' in document.documentElement; | ||
@@ -277,8 +279,4 @@ | ||
function Selectable(options) { | ||
this.version = version; | ||
this.config = extend(defaultConfig, options); | ||
/* Enable emitter */ | ||
Emitter.mixin(this); | ||
this.init(); | ||
@@ -294,2 +292,6 @@ }; | ||
o = this.config; | ||
/* Enable emitter */ | ||
Emitter.mixin(this); | ||
/* lasso */ | ||
@@ -306,3 +308,3 @@ this.lasso = document.createElement('div'); | ||
this.container = document.querySelector(o.appendTo); | ||
} else if (o.appendTo.nodeName) { | ||
} else if (o.appendTo instanceof Element && o.appendTo.nodeName) { | ||
this.container = o.appendTo; | ||
@@ -672,3 +674,3 @@ } | ||
*/ | ||
Selectable.prototype.remove = function(item) { | ||
Selectable.prototype.remove = function(item, stop) { | ||
item = this.getItem(item); | ||
@@ -679,3 +681,3 @@ | ||
for (var i = item.length - 1; i >= 0; i--) { | ||
this.remove(item[i]); | ||
this.remove(item[i], i > 0); | ||
} | ||
@@ -692,3 +694,5 @@ } else { | ||
this.update(); | ||
if (!stop) { | ||
this.update(); | ||
} | ||
@@ -864,13 +868,9 @@ return true; | ||
each(this.items, function(item) { | ||
var el = item.node; | ||
classList.remove(el, o.selectable); | ||
classList.remove(el, o.unselecting); | ||
classList.remove(el, o.selecting); | ||
classList.remove(el, o.selected); | ||
}); | ||
this.disable(); | ||
this.emit('selectable.destroy'); | ||
this.remove(this.items); | ||
each(this, function(val, prop) { | ||
if (prop !== "version" && prop !== "config") delete(this[prop]); | ||
}, this); | ||
}; | ||
@@ -877,0 +877,0 @@ |
@@ -8,5 +8,5 @@ /*! | ||
* | ||
* Version: 0.5.4 | ||
* Version: 0.5.5 | ||
* | ||
*/ | ||
!function(e,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):e.Selectable=t()}("undefined"!=typeof global?global:this.window||this.global,function(){"use strict";function e(e,t,s,i){e.addEventListener(t,s,!1)}function t(e,t,s){e.removeEventListener(t,s)}function s(e){this.config=r(n,e),g.mixin(this),this.init()}var i="classList"in document.documentElement,n={appendTo:document.body,autoRefresh:!0,filter:".ui-selectable",tolerance:"touch",lasso:{border:"1px dotted #3498db",backgroundColor:"rgba(52, 152, 219, 0.2)"},classes:{container:"ui-container",selectable:"ui-selectable",selecting:"ui-selecting",unselecting:"ui-unselecting",selected:"ui-selected"}},o=function(e,t){return e&&e!==document.body&&(t(e)?e:o(e.parentNode,t))},c=function(e){return"[object Object]"===Object.prototype.toString.call(e)},l=function(e){return Array.isArray(e)||e instanceof NodeList||e instanceof HTMLCollection},r=function(e,t){for(var s in t)if(t.hasOwnProperty(s)){var i=t[s];i&&c(i)?(e[s]=e[s]||{},r(e[s],i)):e[s]=i}return e},a=function(e,t,s){var i;if(c(e))for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(s,e[i],i);else for(i=0;i<e.length;i++)t.call(s,e[i],i)},u=function(e,t,s){var i=e&&e.style,n=c(t);if(i){if(void 0===s&&!n)return s=window.getComputedStyle(e,""),void 0===t?s:s[t];n?a(t,function(e,t){t in i||(t="-webkit-"+t),i[t]=e+("string"==typeof e?"":"opacity"===t?"":"px")}):(t in i||(t="-webkit-"+t),i[t]=s+("string"==typeof s?"":"opacity"===t?"":"px"))}},d=function(e){var t=window,s=e.getBoundingClientRect(),i=document.documentElement||document.body.parentNode||document.body,n=void 0!==t.pageXOffset?t.pageXOffset:i.scrollLeft,o=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;return{x1:s.left+n,x2:s.left+s.width+n,y1:s.top+o,y2:s.top+s.height+o,height:s.height,width:s.width}},h=function(e,t,s){var i;return function(){var n=this,o=arguments,c=s&&!i;clearTimeout(i),i=setTimeout(function(){i=null,s||e.apply(n,o)},t),c&&e.apply(n,o)}},f={add:function(e,t){i?e.classList.add(t):f.contains(e,t)||(e.className=e.className.trim()+" "+t)},remove:function(e,t){i?e.classList.remove(t):f.contains(e,t)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," "))},contains:function(e,t){if(e)return i?e.classList.contains(t):!!e.className&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},m=function(e){return!!e.ctrlKey||!!e.metaKey},p=function(e){return!!e.shiftKey},g=function(){};return g.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){this._events=this._events||{},e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(t),1)},emit:function(e){if(this._events=this._events||{},e in this._events!=0)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},g.mixin=function(e){for(var t=["on","off","emit"],s=t.length;s--;)"function"==typeof e?e.prototype[t[s]]=g.prototype[t[s]]:e[t[s]]=g.prototype[t[s]];return e},s.prototype.init=function(){var e=this,t=this.config;this.lasso=document.createElement("div"),this.lasso.className="ui-lasso",u(this.lasso,r({position:"fixed",opacity:0},t.lasso)),"string"==typeof t.appendTo?this.container=document.querySelector(t.appendTo):t.appendTo.nodeName&&(this.container=t.appendTo),l(t.filter)?this.nodes=[].slice.call(t.filter):"string"==typeof t.filter&&(this.nodes=[].slice.call(this.container.querySelectorAll(t.filter))),this.update(),this.enable(),setTimeout(function(){e.emit("selectable.init")},10)},s.prototype.update=function(){var e=this,t=this.config;this.items=[],a(this.nodes,function(s,i){f.add(s,t.classes.selectable),e.items[i]={node:s,rect:d(s),startselected:!1,selected:f.contains(s,t.classes.selected),selecting:f.contains(s,t.classes.selecting),unselecting:f.contains(s,t.classes.unselecting)}}),e.emit("selectable.update")},s.prototype.mousedown=function(e){e.preventDefault();var t,s=this.config,i=o(e.target,function(e){return f.contains(e,s.classes.selectable)});if(this.container.appendChild(this.lasso),this.origin={x:e.pageX,y:e.pageY},!s.disabled){if(i&&f.add(i,s.classes.selecting),s.autoRefresh&&this.update(),p(e))for(var n=!1,c=this.items.length-1;c>=0&&(this.items[c].node===i&&(n=!0),!n||!this.items[c].selected);c--)n&&(this.items[c].selecting=!0);a(this.items,function(n){var o=n.node;n.selected&&o!==i&&(n.startselected=!0,m(e)||p(e)||(f.remove(o,s.classes.selected),n.selected=!1,f.add(o,s.classes.unselecting),n.unselecting=!0)),o===i&&(t=n)}),this.dragging=!0,i&&this.emit("selectable.mousedown",t)}},s.prototype.mousemove=function(e){if(this.dragging){var t=this.config;if(!t.disabled){var s,i={x1:this.origin.x,y1:this.origin.y,x2:e.pageX,y2:e.pageY};i.x1>i.x2&&(s=i.x2,i.x2=i.x1,i.x1=s),i.y1>i.y2&&(s=i.y2,i.y2=i.y1,i.y1=s),u(this.lasso,{opacity:1,left:i.x1,width:i.x2-i.x1,top:i.y1,height:i.y2-i.y1}),a(this.items,function(s){var n=s.node,o=!1;"touch"==t.tolerance?o=!(s.rect.x1>i.x2||s.rect.x2<i.x1||s.rect.y1>i.y2||s.rect.y2<i.y1):"fit"==t.tolerance&&(o=s.rect.x1>i.x1&&s.rect.x2<i.x2&&s.rect.y1>i.y1&&s.rect.y2<i.y2),o?(s.selected&&(f.remove(n,t.classes.selected),s.selected=!1),s.unselecting&&(f.remove(n,t.classes.unselecting),s.unselecting=!1),s.selecting||(f.add(n,t.classes.selecting),s.selecting=!0)):(s.selecting&&(m(e)&&s.startselected?(f.remove(n,t.classes.selecting),s.selecting=!1,f.add(n,t.classes.selected),s.selected=!0):(f.remove(n,t.classes.selecting),s.selecting=!1,s.startselected&&(f.add(n,t.classes.unselecting),s.unselecting=!0))),n.selected&&(m(e)||s.startselected||(f.remove(n,t.classes.selected),s.selected=!1,f.add(n,t.classes.unselecting),s.unselecting=!0)))}),this.emit("selectable.mousemove",i)}}},s.prototype.mouseup=function(e){if(this.dragging&&(this.dragging=!1),this.container.contains(e.target)){var t=this;u(this.lasso,{opacity:0,left:0,width:0,top:0,height:0});var s=[];a(this.items,function(e){e.node;e.unselecting&&t.unselect(e),e.selecting&&(s.push(e),t.select(e))}),this.container.removeChild(this.lasso),this.emit("selectable.mouseup",s)}},s.prototype.select=function(e){if(l(e))return a(e,function(e){this.select(e)},this),this.getSelectedItems();if(e=this.getItem(e)){var t=e.node,s=this.config.classes;return f.remove(t,s.selecting),f.add(t,s.selected),e.selecting=!1,e.selected=!0,e.startselected=!0,this.emit("selectable.select",e),e}return!1},s.prototype.unselect=function(e){if(l(e))return a(e,function(e){this.unselect(e)},this),this.getSelectedItems();if(e=this.getItem(e)){var t=e.node,s=this.config.classes;return e.selecting=!1,e.selected=!1,e.unselecting=!1,e.startselected=!1,f.remove(t,s.unselecting),f.remove(t,s.selecting),f.remove(t,s.selected),this.emit("selectable.unselect",e),e}return!1},s.prototype.add=function(e){this.config;l(e)?a(e,function(e){this.nodes.indexOf(e)<0&&e instanceof Element&&this.nodes.push(e)},this):this.nodes.indexOf(e)<0&&e instanceof Element&&this.nodes.push(e),this.update()},s.prototype.remove=function(e){if(e=this.getItem(e)){if(l(e))for(var t=e.length-1;t>=0;t--)this.remove(e[t]);else{var s=e.node,i=this.config.classes;f.remove(s,i.selectable),f.remove(s,i.unselecting),f.remove(s,i.selecting),f.remove(s,i.selected),this.nodes.splice(this.nodes.indexOf(e.node),1)}return this.update(),!0}return!1},s.prototype.recalculate=function(){a(this.nodes,function(e,t){this.items[t].rect=d(e)},this),this.emit("selectable.recalculate")},s.prototype.selectAll=function(){a(this.items,function(e){this.select(e)},this)},s.prototype.clear=function(){for(var e=this.items.length-1;e>=0;e--)this.unselect(this.items[e])},s.prototype.getItem=function(e){var t=!1;return l(e)?(t=[],a(e,function(e){t.push(this.getItem(e))},this)):isNaN(e)?e instanceof Element?t=this.items[this.nodes.indexOf(e)]:c(e)&&this.items.indexOf(e)>=0&&(t=e):this.items.indexOf(this.items[e])>=0&&(t=this.items[e]),t},s.prototype.getItems=function(){return this.items},s.prototype.getNodes=function(){return this.nodes},s.prototype.getSelectedItems=function(){return this.getItems().filter(function(e){return e.selected})},s.prototype.getSelectedNodes=function(){return this.getSelectedItems().map(function(e){return e.node})},s.prototype.enable=function(){if(!this.enabled){this.enabled=!0;var t={mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this),recalculate:h(this.recalculate,50).bind(this)};e(this.container,"mousedown",t.mousedown),e(document,"mousemove",t.mousemove),e(document,"mouseup",t.mouseup),e(window,"resize",t.recalculate),e(window,"scroll",t.recalculate),this.events=t,f.add(this.container,this.config.classes.container),this.emit("selectable.enable")}return this.enabled},s.prototype.disable=function(){if(this.enabled){var e=this.events;this.enabled=!1,t(this.container,"mousedown",e.mousedown),t(document,"mousemove",e.mousemove),t(document,"mouseup",e.mouseup),t(window,"resize",e.recalculate),t(window,"scroll",e.recalculate),f.remove(this.container,this.config.classes.container),this.emit("selectable.disable")}return this.enabled},s.prototype.destroy=function(){var e=this.config.classes;a(this.items,function(t){var s=t.node;f.remove(s,e.selectable),f.remove(s,e.unselecting),f.remove(s,e.selecting),f.remove(s,e.selected)}),this.disable(),this.emit("selectable.destroy")},s}); | ||
!function(e,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):e.Selectable=t()}("undefined"!=typeof global?global:this.window||this.global,function(){"use strict";function e(e,t,s,i){e.addEventListener(t,s,!1)}function t(e,t,s){e.removeEventListener(t,s)}function s(e){this.version=i,this.config=a(o,e),this.init()}var i="0.5.5",n="classList"in document.documentElement,o={appendTo:document.body,autoRefresh:!0,filter:".ui-selectable",tolerance:"touch",lasso:{border:"1px dotted #3498db",backgroundColor:"rgba(52, 152, 219, 0.2)"},classes:{container:"ui-container",selectable:"ui-selectable",selecting:"ui-selecting",unselecting:"ui-unselecting",selected:"ui-selected"}},c=function(e,t){return e&&e!==document.body&&(t(e)?e:c(e.parentNode,t))},l=function(e){return"[object Object]"===Object.prototype.toString.call(e)},r=function(e){return Array.isArray(e)||e instanceof NodeList||e instanceof HTMLCollection},a=function(e,t){for(var s in t)if(t.hasOwnProperty(s)){var i=t[s];i&&l(i)?(e[s]=e[s]||{},a(e[s],i)):e[s]=i}return e},u=function(e,t,s){var i;if(l(e))for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(s,e[i],i);else for(i=0;i<e.length;i++)t.call(s,e[i],i)},d=function(e,t,s){var i=e&&e.style,n=l(t);if(i){if(void 0===s&&!n)return s=window.getComputedStyle(e,""),void 0===t?s:s[t];n?u(t,function(e,t){t in i||(t="-webkit-"+t),i[t]=e+("string"==typeof e?"":"opacity"===t?"":"px")}):(t in i||(t="-webkit-"+t),i[t]=s+("string"==typeof s?"":"opacity"===t?"":"px"))}},h=function(e){var t=window,s=e.getBoundingClientRect(),i=document.documentElement||document.body.parentNode||document.body,n=void 0!==t.pageXOffset?t.pageXOffset:i.scrollLeft,o=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;return{x1:s.left+n,x2:s.left+s.width+n,y1:s.top+o,y2:s.top+s.height+o,height:s.height,width:s.width}},f=function(e,t,s){var i;return function(){var n=this,o=arguments,c=s&&!i;clearTimeout(i),i=setTimeout(function(){i=null,s||e.apply(n,o)},t),c&&e.apply(n,o)}},m={add:function(e,t){n?e.classList.add(t):m.contains(e,t)||(e.className=e.className.trim()+" "+t)},remove:function(e,t){n?e.classList.remove(t):m.contains(e,t)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," "))},contains:function(e,t){if(e)return n?e.classList.contains(t):!!e.className&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},p=function(e){return!!e.ctrlKey||!!e.metaKey},g=function(e){return!!e.shiftKey},v=function(){};return v.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){this._events=this._events||{},e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(t),1)},emit:function(e){if(this._events=this._events||{},e in this._events!=0)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},v.mixin=function(e){for(var t=["on","off","emit"],s=t.length;s--;)"function"==typeof e?e.prototype[t[s]]=v.prototype[t[s]]:e[t[s]]=v.prototype[t[s]];return e},s.prototype.init=function(){var e=this,t=this.config;v.mixin(this),this.lasso=document.createElement("div"),this.lasso.className="ui-lasso",d(this.lasso,a({position:"fixed",opacity:0},t.lasso)),"string"==typeof t.appendTo?this.container=document.querySelector(t.appendTo):t.appendTo instanceof Element&&t.appendTo.nodeName&&(this.container=t.appendTo),r(t.filter)?this.nodes=[].slice.call(t.filter):"string"==typeof t.filter&&(this.nodes=[].slice.call(this.container.querySelectorAll(t.filter))),this.update(),this.enable(),setTimeout(function(){e.emit("selectable.init")},10)},s.prototype.update=function(){var e=this,t=this.config;this.items=[],u(this.nodes,function(s,i){m.add(s,t.classes.selectable),e.items[i]={node:s,rect:h(s),startselected:!1,selected:m.contains(s,t.classes.selected),selecting:m.contains(s,t.classes.selecting),unselecting:m.contains(s,t.classes.unselecting)}}),e.emit("selectable.update")},s.prototype.mousedown=function(e){e.preventDefault();var t,s=this.config,i=c(e.target,function(e){return m.contains(e,s.classes.selectable)});if(this.container.appendChild(this.lasso),this.origin={x:e.pageX,y:e.pageY},!s.disabled){if(i&&m.add(i,s.classes.selecting),s.autoRefresh&&this.update(),g(e))for(var n=!1,o=this.items.length-1;o>=0&&(this.items[o].node===i&&(n=!0),!n||!this.items[o].selected);o--)n&&(this.items[o].selecting=!0);u(this.items,function(n){var o=n.node;n.selected&&o!==i&&(n.startselected=!0,p(e)||g(e)||(m.remove(o,s.classes.selected),n.selected=!1,m.add(o,s.classes.unselecting),n.unselecting=!0)),o===i&&(t=n)}),this.dragging=!0,i&&this.emit("selectable.mousedown",t)}},s.prototype.mousemove=function(e){if(this.dragging){var t=this.config;if(!t.disabled){var s,i={x1:this.origin.x,y1:this.origin.y,x2:e.pageX,y2:e.pageY};i.x1>i.x2&&(s=i.x2,i.x2=i.x1,i.x1=s),i.y1>i.y2&&(s=i.y2,i.y2=i.y1,i.y1=s),d(this.lasso,{opacity:1,left:i.x1,width:i.x2-i.x1,top:i.y1,height:i.y2-i.y1}),u(this.items,function(s){var n=s.node,o=!1;"touch"==t.tolerance?o=!(s.rect.x1>i.x2||s.rect.x2<i.x1||s.rect.y1>i.y2||s.rect.y2<i.y1):"fit"==t.tolerance&&(o=s.rect.x1>i.x1&&s.rect.x2<i.x2&&s.rect.y1>i.y1&&s.rect.y2<i.y2),o?(s.selected&&(m.remove(n,t.classes.selected),s.selected=!1),s.unselecting&&(m.remove(n,t.classes.unselecting),s.unselecting=!1),s.selecting||(m.add(n,t.classes.selecting),s.selecting=!0)):(s.selecting&&(p(e)&&s.startselected?(m.remove(n,t.classes.selecting),s.selecting=!1,m.add(n,t.classes.selected),s.selected=!0):(m.remove(n,t.classes.selecting),s.selecting=!1,s.startselected&&(m.add(n,t.classes.unselecting),s.unselecting=!0))),n.selected&&(p(e)||s.startselected||(m.remove(n,t.classes.selected),s.selected=!1,m.add(n,t.classes.unselecting),s.unselecting=!0)))}),this.emit("selectable.mousemove",i)}}},s.prototype.mouseup=function(e){if(this.dragging&&(this.dragging=!1),this.container.contains(e.target)){var t=this;d(this.lasso,{opacity:0,left:0,width:0,top:0,height:0});var s=[];u(this.items,function(e){e.node;e.unselecting&&t.unselect(e),e.selecting&&(s.push(e),t.select(e))}),this.container.removeChild(this.lasso),this.emit("selectable.mouseup",s)}},s.prototype.select=function(e){if(r(e))return u(e,function(e){this.select(e)},this),this.getSelectedItems();if(e=this.getItem(e)){var t=e.node,s=this.config.classes;return m.remove(t,s.selecting),m.add(t,s.selected),e.selecting=!1,e.selected=!0,e.startselected=!0,this.emit("selectable.select",e),e}return!1},s.prototype.unselect=function(e){if(r(e))return u(e,function(e){this.unselect(e)},this),this.getSelectedItems();if(e=this.getItem(e)){var t=e.node,s=this.config.classes;return e.selecting=!1,e.selected=!1,e.unselecting=!1,e.startselected=!1,m.remove(t,s.unselecting),m.remove(t,s.selecting),m.remove(t,s.selected),this.emit("selectable.unselect",e),e}return!1},s.prototype.add=function(e){this.config;r(e)?u(e,function(e){this.nodes.indexOf(e)<0&&e instanceof Element&&this.nodes.push(e)},this):this.nodes.indexOf(e)<0&&e instanceof Element&&this.nodes.push(e),this.update()},s.prototype.remove=function(e,t){if(e=this.getItem(e)){if(r(e))for(var s=e.length-1;s>=0;s--)this.remove(e[s],s>0);else{var i=e.node,n=this.config.classes;m.remove(i,n.selectable),m.remove(i,n.unselecting),m.remove(i,n.selecting),m.remove(i,n.selected),this.nodes.splice(this.nodes.indexOf(e.node),1)}return t||this.update(),!0}return!1},s.prototype.recalculate=function(){u(this.nodes,function(e,t){this.items[t].rect=h(e)},this),this.emit("selectable.recalculate")},s.prototype.selectAll=function(){u(this.items,function(e){this.select(e)},this)},s.prototype.clear=function(){for(var e=this.items.length-1;e>=0;e--)this.unselect(this.items[e])},s.prototype.getItem=function(e){var t=!1;return r(e)?(t=[],u(e,function(e){t.push(this.getItem(e))},this)):isNaN(e)?e instanceof Element?t=this.items[this.nodes.indexOf(e)]:l(e)&&this.items.indexOf(e)>=0&&(t=e):this.items.indexOf(this.items[e])>=0&&(t=this.items[e]),t},s.prototype.getItems=function(){return this.items},s.prototype.getNodes=function(){return this.nodes},s.prototype.getSelectedItems=function(){return this.getItems().filter(function(e){return e.selected})},s.prototype.getSelectedNodes=function(){return this.getSelectedItems().map(function(e){return e.node})},s.prototype.enable=function(){if(!this.enabled){this.enabled=!0;var t={mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this),recalculate:f(this.recalculate,50).bind(this)};e(this.container,"mousedown",t.mousedown),e(document,"mousemove",t.mousemove),e(document,"mouseup",t.mouseup),e(window,"resize",t.recalculate),e(window,"scroll",t.recalculate),this.events=t,m.add(this.container,this.config.classes.container),this.emit("selectable.enable")}return this.enabled},s.prototype.disable=function(){if(this.enabled){var e=this.events;this.enabled=!1,t(this.container,"mousedown",e.mousedown),t(document,"mousemove",e.mousemove),t(document,"mouseup",e.mouseup),t(window,"resize",e.recalculate),t(window,"scroll",e.recalculate),m.remove(this.container,this.config.classes.container),this.emit("selectable.disable")}return this.enabled},s.prototype.destroy=function(){this.config.classes;this.disable(),this.remove(this.items),u(this,function(e,t){"version"!==t&&"config"!==t&&delete this[t]},this)},s}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46324