draggable-helper
Advanced tools
Comparing version 1.0.9 to 1.0.10
/*! | ||
* draggable-helper v1.0.9 | ||
* draggable-helper v1.0.10 | ||
* (c) 2018-present phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -106,3 +106,3 @@ * Released under the MIT License. | ||
opacity: 0.6, | ||
position: 'fixed', | ||
position: 'absolute', | ||
left: position.x + 'px', | ||
@@ -109,0 +109,0 @@ top: position.y + 'px' |
/*! | ||
* draggable-helper v1.0.9 | ||
* draggable-helper v1.0.10 | ||
* (c) 2018-present phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -104,3 +104,3 @@ * Released under the MIT License. | ||
opacity: 0.6, | ||
position: 'fixed', | ||
position: 'absolute', | ||
left: position.x + 'px', | ||
@@ -107,0 +107,0 @@ top: position.y + 'px' |
/*! | ||
* draggable-helper v1.0.9 | ||
* draggable-helper v1.0.10 | ||
* (c) 2018-present phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -570,3 +570,3 @@ * Released under the MIT License. | ||
opacity: 0.6, | ||
position: 'fixed', | ||
position: 'absolute', | ||
left: position.x + 'px', | ||
@@ -573,0 +573,0 @@ top: position.y + 'px' |
/*! | ||
* draggable-helper v1.0.9 | ||
* draggable-helper v1.0.10 | ||
* (c) 2018-present phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* Released under the MIT License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.draggableHelper=t()}(this,function(){"use strict";var e;try{e=global}catch(t){e=window}function t(e){var t=e.getBoundingClientRect(),n=function(){if("undefined"!=typeof pageYOffset)return{top:pageYOffset,left:pageXOffset};var e=document.body,t=document.documentElement;return{top:(t=t.clientHeight?t:e).scrollTop,left:t.scrollLeft}}();return{x:t.left+n.left,y:t.top+n.top}}function n(e,t){e["original_".concat(t)]=e.getAttribute(t)}function o(e,t){var n="original_".concat(t);e.setAttribute(t,e[n])}function i(e,t){(function(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)})(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)}function a(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on".concat(t),n)}function s(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent&&e.detachEvent("on".concat(t),n)}function r(e){return{storage:e,set:function(e,t,n){null==t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify({value:t,expired_at:n&&(new Date).getTime()/1e3+60*n}))},get:function(e){var t=this.storage.getItem(e);if(t){if(!(t=JSON.parse(t)).expired_at||t.expired_at>(new Date).getTime())return t.value;this.storage.removeItem(e)}return null},clear:function(){this.storage.clear()}}}r(e.localStorage),r(e.sessionStorage);return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null==r.minTranslate&&(r.minTranslate=10);var l={movedCount:0},u=function(){s(e,"mousedown",e._draggbleEventHandler),delete e._draggbleEventHandler};return e._draggbleEventHandler&&u(),e._draggbleEventHandler=c,a(e,"mousedown",c),u;function c(e){1===e.which&&(e.stopPropagation(),a(document.body,"selectstart",m),l.mouse={x:e.pageX,y:e.pageY},l.initialMouse=Object.assign({},l.mouse),a(document,"mousemove",f),a(window,"mouseup",g))}function d(o){var a=function(){var n=r.getEl?r.getEl(e,r):e,o=n;return r.clone&&(l.triggerEl=n,o=n.cloneNode(!0),n.parentElement.appendChild(o)),{position:function(e,n){var o=e.offsetLeft,i=e.offsetTop,a=t(e);return{x:n.x-(a.x-o),y:n.y-(a.y-i)}}(o,t(n)),el:o}}(),u=a.el,c=a.position;if(l.el=u,l.initialPosition=Object.assign({},c),!1===(r.drag&&r.drag(o,r,l)))return s(document.body,"selectstart",m),!1;var d=function(e){var t=e.style.display;e.style.display="block";var n={width:e.offsetWidth,height:e.offsetHeight};return e.style.display=t,n}(u),f=Object.assign({width:"".concat(d.width,"px"),height:"".concat(d.height,"px"),zIndex:9999,opacity:.6,position:"fixed",left:c.x+"px",top:c.y+"px"},r.style||r.getStyle&&r.getStyle(r)||{});for(var g in n(u,"style"),f)u.style[g]=f[g];n(u,"class"),i(u,r.draggingClass);var v=document.body,p=(v.getAttribute("style")||"").trim();p.length&&!p.endsWith(";")&&(p+=";"),n(v,"style"),v.style=p+"cursor: move;"}function f(e){l.mouse={x:e.pageX,y:e.pageY};var t=l.move={x:l.mouse.x-l.initialMouse.x,y:l.mouse.y-l.initialMouse.y};if(0===l.movedCount&&r.minTranslate){var n=Math.pow(l.move.x,2),o=Math.pow(l.move.y,2);if(Math.pow(n+o,.5)<r.minTranslate)return}var i=!0;if(0===l.movedCount&&!1===d(e)&&(i=!1),i&&r.moving&&!1===r.moving(e,r,l)&&(i=!1),i){if(!l||!l.el)return;Object.assign(l.el.style,{left:l.initialPosition.x+t.x+"px",top:l.initialPosition.y+t.y+"px"}),l.movedCount++}}function g(e){if(s(document,"mousemove",f),s(window,"mouseup",g),l.movedCount>0){l.movedCount=0;var t=l.el;r.clone?t.parentElement.removeChild(t):(o(t,"style"),o(t,"class")),o(document.body,"style"),s(document.body,"selectstart",m),r.drop&&r.drop(e,r,l)}l={movedCount:0}}function m(e){e.preventDefault()}}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.draggableHelper=t()}(this,function(){"use strict";var e;try{e=global}catch(t){e=window}function t(e){var t=e.getBoundingClientRect(),n=function(){if("undefined"!=typeof pageYOffset)return{top:pageYOffset,left:pageXOffset};var e=document.body,t=document.documentElement;return{top:(t=t.clientHeight?t:e).scrollTop,left:t.scrollLeft}}();return{x:t.left+n.left,y:t.top+n.top}}function n(e,t){e["original_".concat(t)]=e.getAttribute(t)}function o(e,t){var n="original_".concat(t);e.setAttribute(t,e[n])}function i(e,t){(function(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)})(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)}function a(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on".concat(t),n)}function s(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent&&e.detachEvent("on".concat(t),n)}function r(e){return{storage:e,set:function(e,t,n){null==t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify({value:t,expired_at:n&&(new Date).getTime()/1e3+60*n}))},get:function(e){var t=this.storage.getItem(e);if(t){if(!(t=JSON.parse(t)).expired_at||t.expired_at>(new Date).getTime())return t.value;this.storage.removeItem(e)}return null},clear:function(){this.storage.clear()}}}r(e.localStorage),r(e.sessionStorage);return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null==r.minTranslate&&(r.minTranslate=10);var l={movedCount:0},u=function(){s(e,"mousedown",e._draggbleEventHandler),delete e._draggbleEventHandler};return e._draggbleEventHandler&&u(),e._draggbleEventHandler=c,a(e,"mousedown",c),u;function c(e){1===e.which&&(e.stopPropagation(),a(document.body,"selectstart",m),l.mouse={x:e.pageX,y:e.pageY},l.initialMouse=Object.assign({},l.mouse),a(document,"mousemove",f),a(window,"mouseup",g))}function d(o){var a=function(){var n=r.getEl?r.getEl(e,r):e,o=n;return r.clone&&(l.triggerEl=n,o=n.cloneNode(!0),n.parentElement.appendChild(o)),{position:function(e,n){var o=e.offsetLeft,i=e.offsetTop,a=t(e);return{x:n.x-(a.x-o),y:n.y-(a.y-i)}}(o,t(n)),el:o}}(),u=a.el,c=a.position;if(l.el=u,l.initialPosition=Object.assign({},c),!1===(r.drag&&r.drag(o,r,l)))return s(document.body,"selectstart",m),!1;var d=function(e){var t=e.style.display;e.style.display="block";var n={width:e.offsetWidth,height:e.offsetHeight};return e.style.display=t,n}(u),f=Object.assign({width:"".concat(d.width,"px"),height:"".concat(d.height,"px"),zIndex:9999,opacity:.6,position:"absolute",left:c.x+"px",top:c.y+"px"},r.style||r.getStyle&&r.getStyle(r)||{});for(var g in n(u,"style"),f)u.style[g]=f[g];n(u,"class"),i(u,r.draggingClass);var v=document.body,p=(v.getAttribute("style")||"").trim();p.length&&!p.endsWith(";")&&(p+=";"),n(v,"style"),v.style=p+"cursor: move;"}function f(e){l.mouse={x:e.pageX,y:e.pageY};var t=l.move={x:l.mouse.x-l.initialMouse.x,y:l.mouse.y-l.initialMouse.y};if(0===l.movedCount&&r.minTranslate){var n=Math.pow(l.move.x,2),o=Math.pow(l.move.y,2);if(Math.pow(n+o,.5)<r.minTranslate)return}var i=!0;if(0===l.movedCount&&!1===d(e)&&(i=!1),i&&r.moving&&!1===r.moving(e,r,l)&&(i=!1),i){if(!l||!l.el)return;Object.assign(l.el.style,{left:l.initialPosition.x+t.x+"px",top:l.initialPosition.y+t.y+"px"}),l.movedCount++}}function g(e){if(s(document,"mousemove",f),s(window,"mouseup",g),l.movedCount>0){l.movedCount=0;var t=l.el;r.clone?t.parentElement.removeChild(t):(o(t,"style"),o(t,"class")),o(document.body,"style"),s(document.body,"selectstart",m),r.drop&&r.drop(e,r,l)}l={movedCount:0}}function m(e){e.preventDefault()}}}); | ||
//# sourceMappingURL=draggable-helper.min.js.map |
{ | ||
"name": "draggable-helper", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/draggable-helper.cjs.js", |
@@ -83,3 +83,3 @@ import { onDOM, offDOM, getElSize, backupAttr, restoreAttr, getOffset, offsetToPosition, addClass } from 'helper-js' | ||
opacity: 0.6, | ||
position: 'fixed', | ||
position: 'absolute', | ||
left: position.x + 'px', | ||
@@ -86,0 +86,0 @@ top: position.y + 'px', |
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
92500