Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "dragula.js", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Drag and drop so simple it hurts", | ||
@@ -5,0 +5,0 @@ "main": "dist/dragula.js", |
@@ -198,2 +198,3 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.dragula=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
dropTarget.insertBefore(item, reference); | ||
api.emit('shadow', item, dropTarget); | ||
} | ||
@@ -550,2 +551,2 @@ } | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkcmFndWxhLmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL3Byb2Nlc3MvYnJvd3Nlci5qcyIsIm5vZGVfbW9kdWxlcy9jb250cmEuZW1pdHRlci9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9jb250cmEuZW1pdHRlci9zcmMvY29udHJhLmVtaXR0ZXIuanMiLCJub2RlX21vZHVsZXMvY3Jvc3N2ZW50L3NyYy9jcm9zc3ZlbnQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI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bn1cblxuZnVuY3Rpb24gdW53cmFwIChlbCwgdHlwZSwgZm4pIHtcbiAgdmFyIGkgPSBmaW5kKGVsLCB0eXBlLCBmbik7XG4gIGlmIChpKSB7XG4gICAgdmFyIHdyYXBwZXIgPSBoYXJkQ2FjaGVbaV0ud3JhcHBlcjtcbiAgICBoYXJkQ2FjaGUuc3BsaWNlKGksIDEpOyAvLyBmcmVlIHVwIGEgdGFkIG9mIG1lbW9yeVxuICAgIHJldHVybiB3cmFwcGVyO1xuICB9XG59XG5cbmZ1bmN0aW9uIGZpbmQgKGVsLCB0eXBlLCBmbikge1xuICB2YXIgaSwgaXRlbTtcbiAgZm9yIChpID0gMDsgaSA8IGhhcmRDYWNoZS5sZW5ndGg7IGkrKykge1xuICAgIGl0ZW0gPSBoYXJkQ2FjaGVbaV07XG4gICAgaWYgKGl0ZW0uZWxlbWVudCA9PT0gZWwgJiYgaXRlbS50eXBlID09PSB0eXBlICYmIGl0ZW0uZm4gPT09IGZuKSB7XG4gICAgICByZXR1cm4gaTtcbiAgICB9XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIGFkZDogYWRkRXZlbnQsXG4gIHJlbW92ZTogcmVtb3ZlRXZlbnQsXG4gIGZhYnJpY2F0ZTogZmFicmljYXRlRXZlbnRcbn07XG4iXX0= |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.dragula=e()}}(function(){return function e(n,t,r){function o(c,u){if(!t[c]){if(!n[c]){var f="function"==typeof require&&require;if(!u&&f)return f(c,!0);if(i)return i(c,!0);var a=new Error("Cannot find module '"+c+"'");throw a.code="MODULE_NOT_FOUND",a}var l=t[c]={exports:{}};n[c][0].call(l.exports,function(e){var t=n[c][1][e];return o(t?t:e)},l,l.exports,e,n,t,r)}return t[c].exports}for(var i="function"==typeof require&&require,c=0;c<r.length;c++)o(r[c]);return o}({1:[function(e,n){"use strict";function t(e,n){function t(n){function t(e){l[r](e,"mousedown",v)}var r=n?"remove":"add";l[r](p,"mouseup",g),e.forEach(t)}function d(){t(!0),g({})}function v(n){if(1===n.which&&!n.metaKey&&!n.ctrlKey&&!S){var t=n.target;if(-1===e.indexOf(t)){for(;-1===e.indexOf(t.parentElement);){if(m(t))return;t=t.parentElement}if(!m(t)){n.preventDefault();var o=t.parentElement,i=r(t);R.copy?(D=t.cloneNode(!0),u(D,"gu-transit")):u(t,"gu-transit"),B=o,L=t,_=n.pageX-i.left,j=n.pageY-i.top,X.emit("drag",L,B),b(),x(n)}}}}function m(e){return"A"===e.tagName||"BUTTON"===e.tagName}function g(e){function n(){var e=N(u,c),n=C(u,e,t,r);u.insertBefore(i,n),X.emit("drop",i,u),E()}if(S){var t=e.clientX,r=e.clientY,i=D||L,c=o(T,t,r),u=w(c);!u||R.copy!==!1&&u===B?R.removeOnSpill?h():y():n()}}function h(){if(S){var e=D||L,n=e.parentElement;n&&n.removeChild(e),X.emit(R.copy?"cancel":"remove",e,n),E()}}function y(e){if(S){var n=arguments.length>0?e:R.revertOnSpill,t=D||L,r=t.parentElement;r===B&&R.copy&&r.removeChild(D),R.copy===!1&&n&&r!==B&&B.appendChild(t),r===B||n?X.emit("cancel",t,B):X.emit("drop",t,r),E()}}function E(){var e=D||L;O(),f(e,"gu-transit"),B=L=D=null}function w(n){function t(){var n=-1!==e.indexOf(r);return n&&R.accepts(L,r,B)}for(var r=n;r&&!t();)r=r.parentElement;return r}function x(e){var n=e.clientX-_,t=e.clientY-j;T.style.left=n+"px",T.style.top=t+"px";var r=o(T,e.clientX,e.clientY),i=w(r);if(i!==B||!R.copy){var u=D||L,f=N(i,r);if(null!==f){var a=C(i,f,e.clientX,e.clientY);(null===a||a!==u&&a!==c(u))&&i.insertBefore(u,a)}}}function b(){var e=L.getBoundingClientRect();S=!0,T=L.cloneNode(!0),T.style.width=e.width+"px",T.style.height=e.height+"px",f(T,"gu-transit"),u(T," gu-mirror"),s.appendChild(T),l.add(p,"mousemove",x),u(s,"gu-unselectable")}function O(){T&&(f(s,"gu-unselectable"),l.remove(p,"mousemove",x),T.parentElement.removeChild(T),T=null,S=!1)}function N(e,n){for(var t=n;t!==e&&t.parentElement!==e;)t=t.parentElement;return t===p?null:t}function C(e,n,t,r){function o(){var n,o,i,c=e.children.length;for(n=0;c>n;n++){if(o=e.children[n],i=o.getBoundingClientRect(),f&&i.left>t)return o;if(!f&&i.top>r)return o}return null}function i(){var e=n.getBoundingClientRect();return u(f?t>e.left+e.width/2:r>e.top+e.height/2)}function u(e){return e?c(n):n}var f="horizontal"===R.direction,a=n!==e?i():o();return a}var S,T,B,L,_,j,D,R=n||{};void 0===R.accepts&&(R.accepts=i),void 0===R.copy&&(R.copy=!1),void 0===R.revertOnSpill&&(R.revertOnSpill=!1),void 0===R.removeOnSpill&&(R.removeOnSpill=!1),void 0===R.direction&&(R.direction="vertical");var X=a({cancel:y,remove:h,destroy:d});return t(),X}function r(e){var n=e.getBoundingClientRect();return{left:n.left+s.scrollLeft,top:n.top+s.scrollTop}}function o(e,n,t){if(!n&&!t)return null;var r=e.className;e.className+=" gu-hide";var o=document.elementFromPoint(n,t);return e.className=r,o}function i(){return!0}function c(e){function n(){var n=e;do n=n.nextSibling;while(n&&1!==n.nodeType);return n}return e.nextElementSibling||n()}function u(e,n){-1===e.className.indexOf(" "+n)&&(e.className+=" "+n)}function f(e,n){e.className=e.className.replace(new RegExp(" "+n,"g"),"")}var a=e("contra.emitter"),l=e("crossvent"),s=document.body,p=document.documentElement;n.exports=t},{"contra.emitter":3,crossvent:5}],2:[function(e,n){function t(){if(!c){c=!0;for(var e,n=i.length;n;){e=i,i=[];for(var t=-1;++t<n;)e[t]();n=i.length}c=!1}}function r(){}var o=n.exports={},i=[],c=!1;o.nextTick=function(e){i.push(e),c||setTimeout(t,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],3:[function(e,n){n.exports=e("./src/contra.emitter.js")},{"./src/contra.emitter.js":4}],4:[function(e,n){(function(e){!function(t,r){"use strict";function o(e,n){return Array.prototype.slice.call(e,n)}function i(e,n,t){e&&u(function(){e.apply(t||null,n||[])})}function c(e,n){var t=n||{},c={};return e===r&&(e={}),e.on=function(n,t){return c[n]?c[n].push(t):c[n]=[t],e},e.once=function(n,t){return t._once=!0,e.on(n,t),e},e.off=function(n,t){var r=arguments.length;if(1===r)delete c[n];else if(0===r)c={};else{var o=c[n];if(!o)return e;o.splice(o.indexOf(t),1)}return e},e.emit=function(){var n=o(arguments);return e.emitterSnapshot(n.shift()).apply(this,n)},e.emitterSnapshot=function(n){var r=(c[n]||[]).slice(0);return function(){var u=o(arguments),f=this||e;if("error"===n&&t["throws"]!==!1&&!r.length)throw 1===u.length?u[0]:u;return c[n]=r.filter(function(e){return t.async?i(e,u,f):e.apply(f,u),!e._once}),e}},e}var u,f=""+r,a="function"==typeof setImmediate;u=a?function(e){setImmediate(e)}:typeof e!==f&&e.nextTick?e.nextTick:function(e){setTimeout(e,0)},typeof n!==f&&n.exports?n.exports=c:(t.contra=t.contra||{},t.contra.emitter=c)}(this)}).call(this,e("_process"))},{_process:2}],5:[function(e,n){(function(e){"use strict";function t(e,n,t,r){return e.addEventListener(n,t,r)}function r(e,n,t){return e.attachEvent("on"+n,f(e,n,t))}function o(e,n,t,r){return e.removeEventListener(n,t,r)}function i(e,n,t){return e.detachEvent("on"+n,a(e,n,t))}function c(e,n){var t;s.createEvent?(t=s.createEvent("Event"),t.initEvent(n,!0,!0),e.dispatchEvent(t)):s.createEventObject&&(t=s.createEventObject(),e.fireEvent("on"+n,t))}function u(n,t,r){return function(t){var o=t||e.event;o.target=o.target||o.srcElement,o.preventDefault=o.preventDefault||function(){o.returnValue=!1},o.stopPropagation=o.stopPropagation||function(){o.cancelBubble=!0},r.call(n,o)}}function f(e,n,t){var r=a(e,n,t)||u(e,n,t);return v.push({wrapper:r,element:e,type:n,fn:t}),r}function a(e,n,t){var r=l(e,n,t);if(r){var o=v[r].wrapper;return v.splice(r,1),o}}function l(e,n,t){var r,o;for(r=0;r<v.length;r++)if(o=v[r],o.element===e&&o.type===n&&o.fn===t)return r}var s=document,p=t,d=o,v=[];e.addEventListener||(p=r,d=i),n.exports={add:p,remove:d,fabricate:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.dragula=e()}}(function(){return function e(n,t,r){function o(c,u){if(!t[c]){if(!n[c]){var f="function"==typeof require&&require;if(!u&&f)return f(c,!0);if(i)return i(c,!0);var a=new Error("Cannot find module '"+c+"'");throw a.code="MODULE_NOT_FOUND",a}var l=t[c]={exports:{}};n[c][0].call(l.exports,function(e){var t=n[c][1][e];return o(t?t:e)},l,l.exports,e,n,t,r)}return t[c].exports}for(var i="function"==typeof require&&require,c=0;c<r.length;c++)o(r[c]);return o}({1:[function(e,n){"use strict";function t(e,n){function t(n){function t(e){l[r](e,"mousedown",v)}var r=n?"remove":"add";l[r](p,"mouseup",g),e.forEach(t)}function d(){t(!0),g({})}function v(n){if(1===n.which&&!n.metaKey&&!n.ctrlKey&&!S){var t=n.target;if(-1===e.indexOf(t)){for(;-1===e.indexOf(t.parentElement);){if(m(t))return;t=t.parentElement}if(!m(t)){n.preventDefault();var o=t.parentElement,i=r(t);R.copy?(D=t.cloneNode(!0),u(D,"gu-transit")):u(t,"gu-transit"),B=o,L=t,_=n.pageX-i.left,j=n.pageY-i.top,X.emit("drag",L,B),b(),x(n)}}}}function m(e){return"A"===e.tagName||"BUTTON"===e.tagName}function g(e){function n(){var e=N(u,c),n=C(u,e,t,r);u.insertBefore(i,n),X.emit("drop",i,u),E()}if(S){var t=e.clientX,r=e.clientY,i=D||L,c=o(T,t,r),u=w(c);!u||R.copy!==!1&&u===B?R.removeOnSpill?h():y():n()}}function h(){if(S){var e=D||L,n=e.parentElement;n&&n.removeChild(e),X.emit(R.copy?"cancel":"remove",e,n),E()}}function y(e){if(S){var n=arguments.length>0?e:R.revertOnSpill,t=D||L,r=t.parentElement;r===B&&R.copy&&r.removeChild(D),R.copy===!1&&n&&r!==B&&B.appendChild(t),r===B||n?X.emit("cancel",t,B):X.emit("drop",t,r),E()}}function E(){var e=D||L;O(),f(e,"gu-transit"),B=L=D=null}function w(n){function t(){var n=-1!==e.indexOf(r);return n&&R.accepts(L,r,B)}for(var r=n;r&&!t();)r=r.parentElement;return r}function x(e){var n=e.clientX-_,t=e.clientY-j;T.style.left=n+"px",T.style.top=t+"px";var r=o(T,e.clientX,e.clientY),i=w(r);if(i!==B||!R.copy){var u=D||L,f=N(i,r);if(null!==f){var a=C(i,f,e.clientX,e.clientY);(null===a||a!==u&&a!==c(u))&&(i.insertBefore(u,a),X.emit("shadow",u,i))}}}function b(){var e=L.getBoundingClientRect();S=!0,T=L.cloneNode(!0),T.style.width=e.width+"px",T.style.height=e.height+"px",f(T,"gu-transit"),u(T," gu-mirror"),s.appendChild(T),l.add(p,"mousemove",x),u(s,"gu-unselectable")}function O(){T&&(f(s,"gu-unselectable"),l.remove(p,"mousemove",x),T.parentElement.removeChild(T),T=null,S=!1)}function N(e,n){for(var t=n;t!==e&&t.parentElement!==e;)t=t.parentElement;return t===p?null:t}function C(e,n,t,r){function o(){var n,o,i,c=e.children.length;for(n=0;c>n;n++){if(o=e.children[n],i=o.getBoundingClientRect(),f&&i.left>t)return o;if(!f&&i.top>r)return o}return null}function i(){var e=n.getBoundingClientRect();return u(f?t>e.left+e.width/2:r>e.top+e.height/2)}function u(e){return e?c(n):n}var f="horizontal"===R.direction,a=n!==e?i():o();return a}var S,T,B,L,_,j,D,R=n||{};void 0===R.accepts&&(R.accepts=i),void 0===R.copy&&(R.copy=!1),void 0===R.revertOnSpill&&(R.revertOnSpill=!1),void 0===R.removeOnSpill&&(R.removeOnSpill=!1),void 0===R.direction&&(R.direction="vertical");var X=a({cancel:y,remove:h,destroy:d});return t(),X}function r(e){var n=e.getBoundingClientRect();return{left:n.left+s.scrollLeft,top:n.top+s.scrollTop}}function o(e,n,t){if(!n&&!t)return null;var r=e.className;e.className+=" gu-hide";var o=document.elementFromPoint(n,t);return e.className=r,o}function i(){return!0}function c(e){function n(){var n=e;do n=n.nextSibling;while(n&&1!==n.nodeType);return n}return e.nextElementSibling||n()}function u(e,n){-1===e.className.indexOf(" "+n)&&(e.className+=" "+n)}function f(e,n){e.className=e.className.replace(new RegExp(" "+n,"g"),"")}var a=e("contra.emitter"),l=e("crossvent"),s=document.body,p=document.documentElement;n.exports=t},{"contra.emitter":3,crossvent:5}],2:[function(e,n){function t(){if(!c){c=!0;for(var e,n=i.length;n;){e=i,i=[];for(var t=-1;++t<n;)e[t]();n=i.length}c=!1}}function r(){}var o=n.exports={},i=[],c=!1;o.nextTick=function(e){i.push(e),c||setTimeout(t,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],3:[function(e,n){n.exports=e("./src/contra.emitter.js")},{"./src/contra.emitter.js":4}],4:[function(e,n){(function(e){!function(t,r){"use strict";function o(e,n){return Array.prototype.slice.call(e,n)}function i(e,n,t){e&&u(function(){e.apply(t||null,n||[])})}function c(e,n){var t=n||{},c={};return e===r&&(e={}),e.on=function(n,t){return c[n]?c[n].push(t):c[n]=[t],e},e.once=function(n,t){return t._once=!0,e.on(n,t),e},e.off=function(n,t){var r=arguments.length;if(1===r)delete c[n];else if(0===r)c={};else{var o=c[n];if(!o)return e;o.splice(o.indexOf(t),1)}return e},e.emit=function(){var n=o(arguments);return e.emitterSnapshot(n.shift()).apply(this,n)},e.emitterSnapshot=function(n){var r=(c[n]||[]).slice(0);return function(){var u=o(arguments),f=this||e;if("error"===n&&t["throws"]!==!1&&!r.length)throw 1===u.length?u[0]:u;return c[n]=r.filter(function(e){return t.async?i(e,u,f):e.apply(f,u),!e._once}),e}},e}var u,f=""+r,a="function"==typeof setImmediate;u=a?function(e){setImmediate(e)}:typeof e!==f&&e.nextTick?e.nextTick:function(e){setTimeout(e,0)},typeof n!==f&&n.exports?n.exports=c:(t.contra=t.contra||{},t.contra.emitter=c)}(this)}).call(this,e("_process"))},{_process:2}],5:[function(e,n){(function(e){"use strict";function t(e,n,t,r){return e.addEventListener(n,t,r)}function r(e,n,t){return e.attachEvent("on"+n,f(e,n,t))}function o(e,n,t,r){return e.removeEventListener(n,t,r)}function i(e,n,t){return e.detachEvent("on"+n,a(e,n,t))}function c(e,n){var t;s.createEvent?(t=s.createEvent("Event"),t.initEvent(n,!0,!0),e.dispatchEvent(t)):s.createEventObject&&(t=s.createEventObject(),e.fireEvent("on"+n,t))}function u(n,t,r){return function(t){var o=t||e.event;o.target=o.target||o.srcElement,o.preventDefault=o.preventDefault||function(){o.returnValue=!1},o.stopPropagation=o.stopPropagation||function(){o.cancelBubble=!0},r.call(n,o)}}function f(e,n,t){var r=a(e,n,t)||u(e,n,t);return v.push({wrapper:r,element:e,type:n,fn:t}),r}function a(e,n,t){var r=l(e,n,t);if(r){var o=v[r].wrapper;return v.splice(r,1),o}}function l(e,n,t){var r,o;for(r=0;r<v.length;r++)if(o=v[r],o.element===e&&o.type===n&&o.fn===t)return r}var s=document,p=t,d=o,v=[];e.addEventListener||(p=r,d=i),n.exports={add:p,remove:d,fabricate:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |
@@ -197,2 +197,3 @@ 'use strict'; | ||
dropTarget.insertBefore(item, reference); | ||
api.emit('shadow', item, dropTarget); | ||
} | ||
@@ -199,0 +200,0 @@ } |
{ | ||
"name": "dragula", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Drag and drop so simple it hurts", | ||
@@ -5,0 +5,0 @@ "main": "dragula.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
420024
994
115