@scena/dragscroll
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/dragscroll.git | ||
version: 0.0.5 | ||
version: 0.0.6 | ||
*/ | ||
@@ -124,3 +124,3 @@ 'use strict'; | ||
direction: direction, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -156,3 +156,3 @@ return true; | ||
offsetY: direction[1] ? offsetY : 0, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -159,0 +159,0 @@ return true; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/dragscroll.git | ||
version: 0.0.5 | ||
version: 0.0.6 | ||
*/ | ||
@@ -122,3 +122,3 @@ import Component from '@egjs/component'; | ||
direction: direction, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -154,3 +154,3 @@ return true; | ||
offsetY: direction[1] ? offsetY : 0, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -157,0 +157,0 @@ return true; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/dragscroll.git | ||
version: 0.0.5 | ||
version: 0.0.6 | ||
*/ | ||
@@ -126,3 +126,3 @@ (function (global, factory) { | ||
direction: direction, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -158,3 +158,3 @@ return true; | ||
offsetY: direction[1] ? offsetY : 0, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -161,0 +161,0 @@ return true; |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/dragscroll.git | ||
version: 0.0.5 | ||
version: 0.0.6 | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/component")):"function"==typeof define&&define.amd?define(["@egjs/component"],e):(t=t||self).DragScroll=e(t.Component)}(this,function(t){"use strict";var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function l(t){var e=t.container;return[e.scrollLeft,e.scrollTop]}return function(e){function t(){this.constructor=n}var n,r;function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.prevDirection=null,t.prevPos=[],t}c(n=o,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var i=o.prototype;return i.dragStart=function(t){var e=t.getBoundingClientRect(),n=e.top,r=e.left,o=e.width,i=e.height;this.startRect={top:n,left:r,width:o,height:i}},i.drag=function(t,e){var n=t.clientX,r=t.clientY;this.prevDirection=null;var o=e.container,i=e.threshold,c=void 0===i?0:i,p=e.getScrollPosition,s=void 0===p?l:p,u=this.startRect,f=[0,0];return u.top>r-c?f[1]=-1:u.top+u.height<r+c&&(f[1]=1),u.left>n-c?f[0]=-1:u.left+u.width<n+c&&(f[0]=1),!(!f[0]&&!f[1])&&(this.prevDirection=f,this.prevPos=s({container:o,direction:f}),this.trigger("scroll",{container:o,direction:f,inputEvent:t.inputEvent}),!0)},i.dragAfter=function(t,e){var n=this.prevPos,r=this.prevDirection;if(!this.prevDirection)return!1;var o=e.container,i=e.getScrollPosition,c=(void 0===i?l:i)({container:o,direction:r}),p=c[0]-n[0],s=c[1]-n[1];return!(!p&&!s)&&(this.trigger("move",{offsetX:r[0]?p:0,offsetY:r[1]?s:0,inputEvent:t.inputEvent}),!0)},o}(t)}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/component")):"function"==typeof define&&define.amd?define(["@egjs/component"],e):(t=t||self).DragScroll=e(t.Component)}(this,function(t){"use strict";var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t){var e=t.container;return[e.scrollLeft,e.scrollTop]}return function(e){function t(){this.constructor=r}var r,n;function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.prevDirection=null,t.prevPos=[],t}c(r=o,n=e),r.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t);var i=o.prototype;return i.dragStart=function(t){var e=t.getBoundingClientRect(),r=e.top,n=e.left,o=e.width,i=e.height;this.startRect={top:r,left:n,width:o,height:i}},i.drag=function(t,e){var r=t.clientX,n=t.clientY;this.prevDirection=null;var o=e.container,i=e.threshold,c=void 0===i?0:i,s=e.getScrollPosition,p=void 0===s?l:s,f=this.startRect,u=[0,0];return f.top>n-c?u[1]=-1:f.top+f.height<n+c&&(u[1]=1),f.left>r-c?u[0]=-1:f.left+f.width<r+c&&(u[0]=1),!(!u[0]&&!u[1])&&(this.prevDirection=u,this.prevPos=p({container:o,direction:u}),this.trigger("scroll",{container:o,direction:u,inputEvent:t}),!0)},i.dragAfter=function(t,e){var r=this.prevPos,n=this.prevDirection;if(!this.prevDirection)return!1;var o=e.container,i=e.getScrollPosition,c=(void 0===i?l:i)({container:o,direction:n}),s=c[0]-r[0],p=c[1]-r[1];return!(!s&&!p)&&(this.trigger("move",{offsetX:n[0]?s:0,offsetY:n[1]?p:0,inputEvent:t}),!0)},o}(t)}); | ||
//# sourceMappingURL=dragscroll.min.js.map |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/dragscroll.git | ||
version: 0.0.5 | ||
version: 0.0.6 | ||
*/ | ||
@@ -416,3 +416,3 @@ (function (global, factory) { | ||
direction: direction, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -448,3 +448,3 @@ return true; | ||
offsetY: direction[1] ? offsetY : 0, | ||
inputEvent: e.inputEvent | ||
inputEvent: e | ||
}); | ||
@@ -451,0 +451,0 @@ return true; |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/dragscroll.git | ||
version: 0.0.5 | ||
version: 0.0.6 | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).DragScroll=n()}(this,function(){"use strict";var f=function(t,n){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};function c(t){return void 0===t}function h(t){var n=t.container;return[n.scrollLeft,n.scrollTop]}return function(n){function t(){this.constructor=e}var e,r;function i(){var t=null!==n&&n.apply(this,arguments)||this;return t.startRect=null,t.prevDirection=null,t.prevPos=[],t}f(e=i,r=n),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return o.dragStart=function(t){var n=t.getBoundingClientRect(),e=n.top,r=n.left,i=n.width,o=n.height;this.startRect={top:e,left:r,width:i,height:o}},o.drag=function(t,n){var e=t.clientX,r=t.clientY;this.prevDirection=null;var i=n.container,o=n.threshold,f=void 0===o?0:o,c=n.getScrollPosition,s=void 0===c?h:c,u=this.startRect,a=[0,0];return u.top>r-f?a[1]=-1:u.top+u.height<r+f&&(a[1]=1),u.left>e-f?a[0]=-1:u.left+u.width<e+f&&(a[0]=1),!(!a[0]&&!a[1])&&(this.prevDirection=a,this.prevPos=s({container:i,direction:a}),this.trigger("scroll",{container:i,direction:a,inputEvent:t.inputEvent}),!0)},o.dragAfter=function(t,n){var e=this.prevPos,r=this.prevDirection;if(!this.prevDirection)return!1;var i=n.container,o=n.getScrollPosition,f=(void 0===o?h:o)({container:i,direction:r}),c=f[0]-e[0],s=f[1]-e[1];return!(!c&&!s)&&(this.trigger("move",{offsetX:r[0]?c:0,offsetY:r[1]?s:0,inputEvent:t.inputEvent}),!0)},i}(function(){var t=function(){function t(){this._eventHandler={},this.options={}}var n=t.prototype;return n.trigger=function(t,n){void 0===n&&(n={});var e=this._eventHandler[t]||[];if(!(0<e.length))return!0;e=e.concat(),n.eventType=t;var r=!1,i=[n],o=0;n.stop=function(){r=!0},n.currentTarget=this;for(var f=arguments.length,c=new Array(2<f?f-2:0),s=2;s<f;s++)c[s-2]=arguments[s];for(1<=c.length&&(i=i.concat(c)),o=0;e[o];o++)e[o].apply(this,i);return!r},n.once=function(i,o){if("object"==typeof i&&c(o)){var t,n=i;for(t in n)this.once(t,n[t]);return this}if("string"==typeof i&&"function"==typeof o){var f=this;this.on(i,function t(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];o.apply(f,e),f.off(i,t)})}return this},n.hasOn=function(t){return!!this._eventHandler[t]},n.on=function(t,n){if("object"==typeof t&&c(n)){var e,r=t;for(e in r)this.on(e,r[e]);return this}if("string"==typeof t&&"function"==typeof n){var i=this._eventHandler[t];c(i)&&(this._eventHandler[t]=[],i=this._eventHandler[t]),i.push(n)}return this},n.off=function(t,n){if(c(t))return this._eventHandler={},this;if(c(n)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var e,r=t;for(e in r)this.off(e,r[e]);return this}var i,o,f=this._eventHandler[t];if(f)for(i=0;void 0!==(o=f[i]);i++)if(o===n){f=f.splice(i,1);break}return this},t}();return t.VERSION="2.1.2",t}())}); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).DragScroll=n()}(this,function(){"use strict";var f=function(t,n){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(t,n)};function c(t){return void 0===t}function h(t){var n=t.container;return[n.scrollLeft,n.scrollTop]}return function(n){function t(){this.constructor=r}var r,e;function i(){var t=null!==n&&n.apply(this,arguments)||this;return t.startRect=null,t.prevDirection=null,t.prevPos=[],t}f(r=i,e=n),r.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t);var o=i.prototype;return o.dragStart=function(t){var n=t.getBoundingClientRect(),r=n.top,e=n.left,i=n.width,o=n.height;this.startRect={top:r,left:e,width:i,height:o}},o.drag=function(t,n){var r=t.clientX,e=t.clientY;this.prevDirection=null;var i=n.container,o=n.threshold,f=void 0===o?0:o,c=n.getScrollPosition,s=void 0===c?h:c,u=this.startRect,a=[0,0];return u.top>e-f?a[1]=-1:u.top+u.height<e+f&&(a[1]=1),u.left>r-f?a[0]=-1:u.left+u.width<r+f&&(a[0]=1),!(!a[0]&&!a[1])&&(this.prevDirection=a,this.prevPos=s({container:i,direction:a}),this.trigger("scroll",{container:i,direction:a,inputEvent:t}),!0)},o.dragAfter=function(t,n){var r=this.prevPos,e=this.prevDirection;if(!this.prevDirection)return!1;var i=n.container,o=n.getScrollPosition,f=(void 0===o?h:o)({container:i,direction:e}),c=f[0]-r[0],s=f[1]-r[1];return!(!c&&!s)&&(this.trigger("move",{offsetX:e[0]?c:0,offsetY:e[1]?s:0,inputEvent:t}),!0)},i}(function(){var t=function(){function t(){this._eventHandler={},this.options={}}var n=t.prototype;return n.trigger=function(t,n){void 0===n&&(n={});var r=this._eventHandler[t]||[];if(!(0<r.length))return!0;r=r.concat(),n.eventType=t;var e=!1,i=[n],o=0;n.stop=function(){e=!0},n.currentTarget=this;for(var f=arguments.length,c=new Array(2<f?f-2:0),s=2;s<f;s++)c[s-2]=arguments[s];for(1<=c.length&&(i=i.concat(c)),o=0;r[o];o++)r[o].apply(this,i);return!e},n.once=function(i,o){if("object"==typeof i&&c(o)){var t,n=i;for(t in n)this.once(t,n[t]);return this}if("string"==typeof i&&"function"==typeof o){var f=this;this.on(i,function t(){for(var n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];o.apply(f,r),f.off(i,t)})}return this},n.hasOn=function(t){return!!this._eventHandler[t]},n.on=function(t,n){if("object"==typeof t&&c(n)){var r,e=t;for(r in e)this.on(r,e[r]);return this}if("string"==typeof t&&"function"==typeof n){var i=this._eventHandler[t];c(i)&&(this._eventHandler[t]=[],i=this._eventHandler[t]),i.push(n)}return this},n.off=function(t,n){if(c(t))return this._eventHandler={},this;if(c(n)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var r,e=t;for(r in e)this.off(r,e[r]);return this}var i,o,f=this._eventHandler[t];if(f)for(i=0;void 0!==(o=f[i]);i++)if(o===n){f=f.splice(i,1);break}return this},t}();return t.VERSION="2.1.2",t}())}); | ||
//# sourceMappingURL=dragscroll.pkgd.min.js.map |
{ | ||
"name": "@scena/dragscroll", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/dragscroll.cjs.js", |
@@ -65,3 +65,3 @@ import Component from "@egjs/component"; | ||
direction, | ||
inputEvent: e.inputEvent, | ||
inputEvent: e, | ||
}); | ||
@@ -94,3 +94,3 @@ return true; | ||
offsetY: direction[1] ? offsetY : 0, | ||
inputEvent: e.inputEvent, | ||
inputEvent: e, | ||
}); | ||
@@ -97,0 +97,0 @@ return true; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
73899