@mattlewis92/dom-autoscroller
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -60,3 +60,3 @@ import { boolean } from 'type-func'; | ||
if (typeof this.margin !== 'object') { | ||
if (typeof options.margin !== 'object') { | ||
var margin = options.margin || -1; | ||
@@ -70,2 +70,4 @@ | ||
}; | ||
} else { | ||
this.margin = options.margin; | ||
} | ||
@@ -72,0 +74,0 @@ |
@@ -64,3 +64,3 @@ 'use strict'; | ||
if (typeof this.margin !== 'object') { | ||
if (typeof options.margin !== 'object') { | ||
var margin = options.margin || -1; | ||
@@ -74,2 +74,4 @@ | ||
}; | ||
} else { | ||
this.margin = options.margin; | ||
} | ||
@@ -76,0 +78,0 @@ |
@@ -708,3 +708,3 @@ var autoScroll = (function () { | ||
if (typeof this.margin !== 'object') { | ||
if (typeof options.margin !== 'object') { | ||
var margin = options.margin || -1; | ||
@@ -718,2 +718,4 @@ | ||
}; | ||
} else { | ||
this.margin = options.margin; | ||
} | ||
@@ -720,0 +722,0 @@ |
@@ -1,1 +0,1 @@ | ||
var autoScroll=function(){"use strict";function e(e,t){return void 0===e?void 0===t?e:t:e}function t(t,n){return t=e(t,n),"function"==typeof t?function(){for(var e=arguments,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=e[o];return!!t.apply(this,r)}:t?function(){return!0}:function(){return!1}}function n(e,t){if(t=u(t,!0),!b(t))return-1;for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function r(e,t){return-1!==n(e,t)}function o(e,t){for(var n=0;n<t.length;n++)r(e,t[n])||e.push(t[n]);return t}function i(e){for(var t=arguments,n=[],r=arguments.length-1;r-- >0;)n[r]=t[r+1];return n=n.map(u),o(e,n)}function a(e){for(var t=arguments,r=[],o=arguments.length-1;o-- >0;)r[o]=t[o+1];return r.map(u).reduce(function(t,r){var o=n(e,r);return-1!==o?t.concat(e.splice(o,1)):t},[])}function u(e,t){if("string"==typeof e)try{return document.querySelector(e)}catch(e){throw e}if(!b(e)&&!t)throw new TypeError(e+" is not a DOM element.");return e}function c(e,n){n=n||{};var r=t(n.allowUpdate,!0);return function(t){if(t=t||window.event,e.target=t.target||t.srcElement||t.originalTarget,e.element=this,e.type=t.type,r(t)){if(t.targetTouches)e.x=t.targetTouches[0].clientX,e.y=t.targetTouches[0].clientY,e.pageX=t.targetTouches[0].pageX,e.pageY=t.targetTouches[0].pageY,e.screenX=t.targetTouches[0].screenX,e.screenY=t.targetTouches[0].screenY;else{if(null===t.pageX&&null!==t.clientX){var n=t.target&&t.target.ownerDocument||document,o=n.documentElement,i=n.body;e.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}else e.pageX=t.pageX,e.pageY=t.pageY;e.x=t.clientX,e.y=t.clientY,e.screenX=t.screenX,e.screenY=t.screenY}e.clientX=e.x,e.clientY=e.y}}}function l(){var e={top:{value:0,enumerable:!0},left:{value:0,enumerable:!0},right:{value:window.innerWidth,enumerable:!0},bottom:{value:window.innerHeight,enumerable:!0},width:{value:window.innerWidth,enumerable:!0},height:{value:window.innerHeight,enumerable:!0},x:{value:0,enumerable:!0},y:{value:0,enumerable:!0}};if(Object.create)return Object.create({},e);var t={};return Object.defineProperties(t,e),t}function f(e){if(e===window)return l();try{var t=e.getBoundingClientRect();return void 0===t.x&&(t.x=t.left,t.y=t.top),t}catch(t){throw new TypeError("Can't call getBoundingClientRect on "+e)}}function d(e,t){var n=f(t);return e.y>n.top&&e.y<n.bottom&&e.x>n.left&&e.x<n.right}function m(e){function t(e){for(var t=0;t<x.length;t++)r[x[t]]=e[x[t]]}function n(){e&&e.removeEventListener("mousemove",t,!1),r=null}var r={screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1,button:0,buttons:1,relatedTarget:null,region:null};return void 0!==e&&e.addEventListener("mousemove",t),{destroy:n,dispatch:function(){return MouseEvent?function(e,t,n){var o=new MouseEvent("mousemove",s(r,t));return v(o,n),e.dispatchEvent(o)}:"function"==typeof document.createEvent?function(e,t,n){var o=s(r,t),i=document.createEvent("MouseEvents");return i.initMouseEvent("mousemove",!0,!0,window,0,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget),v(i,n),e.dispatchEvent(i)}:"function"==typeof document.createEventObject?function(e,t,n){var o=document.createEventObject(),i=s(r,t);for(var a in i)o[a]=i[a];return v(o,n),e.dispatchEvent(o)}:void 0}()}}function s(e,t){t=t||{};for(var n=T(e),r=0;r<x.length;r++)void 0!==t[x[r]]&&(n[x[r]]=t[x[r]]);return n}function v(e,t){console.log("data ",t),e.data=t||{},e.dispatched="mousemove"}function w(e,n){function o(t){for(var n=0;n<e.length;n++)if(e[n]===t.target){j=!0;break}j&&X(function(){return j=!1})}function u(){F=!0}function l(){F=!1,d()}function d(){Y(N),Y(K)}function s(){F=!1}function v(t){if(!t)return null;if(C===t)return t;if(r(e,t))return t;for(;t=t.parentNode;)if(r(e,t))return t;return null}function w(){for(var t=null,n=0;n<e.length;n++)h(O,e[n])&&(t=e[n]);return t}function p(e){if(x.autoScroll()&&!e.dispatched){var t=e.target,n=document.body;C&&!h(O,C)&&(x.scrollWhenOutside||(C=null)),t&&t.parentNode===n?t=w():(t=v(t))||(t=w()),t&&t!==C&&(C=t),q&&(Y(K),K=X(g)),C&&(Y(N),N=X(y))}}function g(){b(q),Y(K),K=X(g)}function y(){C&&(b(C),Y(N),N=X(y))}function b(e){var t,n,r=f(e);t=O.x<r.left+x.margin.left?Math.floor(Math.max(-1,(O.x-r.left)/x.margin.left-1)*x.maxSpeed.left):O.x>r.right-x.margin.right?Math.ceil(Math.min(1,(O.x-r.right)/x.margin.right+1)*x.maxSpeed.right):0,n=O.y<r.top+x.margin.top?Math.floor(Math.max(-1,(O.y-r.top)/x.margin.top-1)*x.maxSpeed.top):O.y>r.bottom-x.margin.bottom?Math.ceil(Math.min(1,(O.y-r.bottom)/x.margin.bottom+1)*x.maxSpeed.bottom):0,x.syncMove()&&M.dispatch(e,{pageX:O.pageX+t,pageY:O.pageY+n,clientX:O.x+t,clientY:O.y+n}),setTimeout(function(){n&&E(e,n),t&&T(e,t)})}function E(e,t){e===window?window.scrollTo(e.pageXOffset,e.pageYOffset+t):e.scrollTop+=t}function T(e,t){e===window?window.scrollTo(e.pageXOffset+t,e.pageYOffset):e.scrollLeft+=t}void 0===n&&(n={});var x=this,L=4,j=!1;if("object"!=typeof this.margin){var A=n.margin||-1;this.margin={left:A,right:A,top:A,bottom:A}}this.scrollWhenOutside=n.scrollWhenOutside||!1;var O={},S=c(O),M=m(),F=!1;window.addEventListener("mousemove",S,!1),window.addEventListener("touchmove",S,!1),isNaN(n.maxSpeed)||(L=n.maxSpeed),"object"!=typeof L&&(L={left:L,right:L,top:L,bottom:L}),this.autoScroll=t(n.autoScroll),this.syncMove=t(n.syncMove,!1),this.destroy=function(t){window.removeEventListener("mousemove",S,!1),window.removeEventListener("touchmove",S,!1),window.removeEventListener("mousedown",u,!1),window.removeEventListener("touchstart",u,!1),window.removeEventListener("mouseup",l,!1),window.removeEventListener("touchend",l,!1),window.removeEventListener("pointerup",l,!1),window.removeEventListener("mouseleave",s,!1),window.removeEventListener("mousemove",p,!1),window.removeEventListener("touchmove",p,!1),window.removeEventListener("scroll",o,!0),e=[],t&&d()},this.add=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return i.apply(void 0,[e].concat(t)),this},this.remove=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return a.apply(void 0,[e].concat(t))};var K,q=null;"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),function(t){e=[],t.forEach(function(e){e===window?q=window:x.add(e)})}(e),Object.defineProperties(this,{down:{get:function(){return F}},maxSpeed:{get:function(){return L}},point:{get:function(){return O}},scrolling:{get:function(){return j}}});var N,C=null;window.addEventListener("mousedown",u,!1),window.addEventListener("touchstart",u,!1),window.addEventListener("mouseup",l,!1),window.addEventListener("touchend",l,!1),window.addEventListener("pointerup",l,!1),window.addEventListener("mousemove",p,!1),window.addEventListener("touchmove",p,!1),window.addEventListener("mouseleave",s,!1),window.addEventListener("scroll",o,!0)}function p(e,t){return new w(e,t)}function h(e,t,n){return n?e.y>n.top&&e.y<n.bottom&&e.x>n.left&&e.x<n.right:d(e,t)}var g=function(){var e=function(e){return"function"==typeof e},t=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t},n=Math.pow(2,53)-1,r=function(e){var r=t(e);return Math.min(Math.max(r,0),n)},o=function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}},i=function(t,n){if(null!=t&&null!=n){var r=t[n];if(null==r)return;if(!e(r))throw new TypeError(r+" is not a function");return r}},a=function(e){var t=e.next();return!Boolean(t.done)&&t};return function(t){var n,u=this,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!e(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}var l,f,d=i(t,o(t));if(void 0!==d){l=e(u)?Object(new u):[];var m=d.call(t);if(null==m)throw new TypeError("Array.from requires an array-like or iterable object");f=0;for(var s,v;;){if(!(s=a(m)))return l.length=f,l;v=s.value,l[f]=c?c.call(n,v,f):v,f++}}else{var w=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=r(w.length);l=e(u)?Object(new u(p)):new Array(p),f=0;for(var h;f<p;)h=w[f],l[f]=c?c.call(n,h,f):h,f++;l.length=p}return l}}(),y=("function"==typeof Array.from&&Array.from,Array.isArray,Object.prototype.toString,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}),b=function(e){return null!=e&&"object"===(void 0===e?"undefined":y(e))&&1===e.nodeType&&"object"===y(e.style)&&"object"===y(e.ownerDocument)},E=void 0;E="function"!=typeof Object.create?function(e){var t=function(){};return function(e,n){if(e!==Object(e)&&null!==e)throw TypeError("Argument must be an object, or null");t.prototype=e||{};var r=new t;return t.prototype=null,void 0!==n&&Object.defineProperties(r,n),null===e&&(r.__proto__=null),r}}():Object.create;var T=E,x=["altKey","button","buttons","clientX","clientY","ctrlKey","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","region","relatedTarget","screenX","screenY","shiftKey","which","x","y"],L=["webkit","moz","ms","o"],X=function(){if("undefined"==typeof window)return function(){};for(var e=0,t=L.length;e<t&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[L[e]+"RequestAnimationFrame"];if(!window.requestAnimationFrame){var n=0;window.requestAnimationFrame=function(e){var t=(new Date).getTime(),r=Math.max(0,16-t-n),o=window.setTimeout(function(){return e(t+r)},r);return n=t+r,o}}return window.requestAnimationFrame.bind(window)}(),Y=function(){if("undefined"==typeof window)return function(){};for(var e=0,t=L.length;e<t&&!window.cancelAnimationFrame;++e)window.cancelAnimationFrame=window[L[e]+"CancelAnimationFrame"]||window[L[e]+"CancelRequestAnimationFrame"];return window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){window.clearTimeout(e)}),window.cancelAnimationFrame.bind(window)}();return p}(); | ||
var autoScroll=function(){"use strict";function e(e,t){return void 0===e?void 0===t?e:t:e}function t(t,n){return t=e(t,n),"function"==typeof t?function(){for(var e=arguments,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=e[o];return!!t.apply(this,r)}:t?function(){return!0}:function(){return!1}}function n(e,t){if(t=u(t,!0),!b(t))return-1;for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function r(e,t){return-1!==n(e,t)}function o(e,t){for(var n=0;n<t.length;n++)r(e,t[n])||e.push(t[n]);return t}function i(e){for(var t=arguments,n=[],r=arguments.length-1;r-- >0;)n[r]=t[r+1];return n=n.map(u),o(e,n)}function a(e){for(var t=arguments,r=[],o=arguments.length-1;o-- >0;)r[o]=t[o+1];return r.map(u).reduce(function(t,r){var o=n(e,r);return-1!==o?t.concat(e.splice(o,1)):t},[])}function u(e,t){if("string"==typeof e)try{return document.querySelector(e)}catch(e){throw e}if(!b(e)&&!t)throw new TypeError(e+" is not a DOM element.");return e}function c(e,n){n=n||{};var r=t(n.allowUpdate,!0);return function(t){if(t=t||window.event,e.target=t.target||t.srcElement||t.originalTarget,e.element=this,e.type=t.type,r(t)){if(t.targetTouches)e.x=t.targetTouches[0].clientX,e.y=t.targetTouches[0].clientY,e.pageX=t.targetTouches[0].pageX,e.pageY=t.targetTouches[0].pageY,e.screenX=t.targetTouches[0].screenX,e.screenY=t.targetTouches[0].screenY;else{if(null===t.pageX&&null!==t.clientX){var n=t.target&&t.target.ownerDocument||document,o=n.documentElement,i=n.body;e.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}else e.pageX=t.pageX,e.pageY=t.pageY;e.x=t.clientX,e.y=t.clientY,e.screenX=t.screenX,e.screenY=t.screenY}e.clientX=e.x,e.clientY=e.y}}}function l(){var e={top:{value:0,enumerable:!0},left:{value:0,enumerable:!0},right:{value:window.innerWidth,enumerable:!0},bottom:{value:window.innerHeight,enumerable:!0},width:{value:window.innerWidth,enumerable:!0},height:{value:window.innerHeight,enumerable:!0},x:{value:0,enumerable:!0},y:{value:0,enumerable:!0}};if(Object.create)return Object.create({},e);var t={};return Object.defineProperties(t,e),t}function f(e){if(e===window)return l();try{var t=e.getBoundingClientRect();return void 0===t.x&&(t.x=t.left,t.y=t.top),t}catch(t){throw new TypeError("Can't call getBoundingClientRect on "+e)}}function d(e,t){var n=f(t);return e.y>n.top&&e.y<n.bottom&&e.x>n.left&&e.x<n.right}function m(e){function t(e){for(var t=0;t<x.length;t++)r[x[t]]=e[x[t]]}function n(){e&&e.removeEventListener("mousemove",t,!1),r=null}var r={screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1,button:0,buttons:1,relatedTarget:null,region:null};return void 0!==e&&e.addEventListener("mousemove",t),{destroy:n,dispatch:function(){return MouseEvent?function(e,t,n){var o=new MouseEvent("mousemove",s(r,t));return v(o,n),e.dispatchEvent(o)}:"function"==typeof document.createEvent?function(e,t,n){var o=s(r,t),i=document.createEvent("MouseEvents");return i.initMouseEvent("mousemove",!0,!0,window,0,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget),v(i,n),e.dispatchEvent(i)}:"function"==typeof document.createEventObject?function(e,t,n){var o=document.createEventObject(),i=s(r,t);for(var a in i)o[a]=i[a];return v(o,n),e.dispatchEvent(o)}:void 0}()}}function s(e,t){t=t||{};for(var n=T(e),r=0;r<x.length;r++)void 0!==t[x[r]]&&(n[x[r]]=t[x[r]]);return n}function v(e,t){console.log("data ",t),e.data=t||{},e.dispatched="mousemove"}function w(e,n){function o(t){for(var n=0;n<e.length;n++)if(e[n]===t.target){j=!0;break}j&&X(function(){return j=!1})}function u(){F=!0}function l(){F=!1,d()}function d(){Y(N),Y(K)}function s(){F=!1}function v(t){if(!t)return null;if(C===t)return t;if(r(e,t))return t;for(;t=t.parentNode;)if(r(e,t))return t;return null}function w(){for(var t=null,n=0;n<e.length;n++)h(O,e[n])&&(t=e[n]);return t}function p(e){if(x.autoScroll()&&!e.dispatched){var t=e.target,n=document.body;C&&!h(O,C)&&(x.scrollWhenOutside||(C=null)),t&&t.parentNode===n?t=w():(t=v(t))||(t=w()),t&&t!==C&&(C=t),q&&(Y(K),K=X(g)),C&&(Y(N),N=X(y))}}function g(){b(q),Y(K),K=X(g)}function y(){C&&(b(C),Y(N),N=X(y))}function b(e){var t,n,r=f(e);t=O.x<r.left+x.margin.left?Math.floor(Math.max(-1,(O.x-r.left)/x.margin.left-1)*x.maxSpeed.left):O.x>r.right-x.margin.right?Math.ceil(Math.min(1,(O.x-r.right)/x.margin.right+1)*x.maxSpeed.right):0,n=O.y<r.top+x.margin.top?Math.floor(Math.max(-1,(O.y-r.top)/x.margin.top-1)*x.maxSpeed.top):O.y>r.bottom-x.margin.bottom?Math.ceil(Math.min(1,(O.y-r.bottom)/x.margin.bottom+1)*x.maxSpeed.bottom):0,x.syncMove()&&M.dispatch(e,{pageX:O.pageX+t,pageY:O.pageY+n,clientX:O.x+t,clientY:O.y+n}),setTimeout(function(){n&&E(e,n),t&&T(e,t)})}function E(e,t){e===window?window.scrollTo(e.pageXOffset,e.pageYOffset+t):e.scrollTop+=t}function T(e,t){e===window?window.scrollTo(e.pageXOffset+t,e.pageYOffset):e.scrollLeft+=t}void 0===n&&(n={});var x=this,L=4,j=!1;if("object"!=typeof n.margin){var A=n.margin||-1;this.margin={left:A,right:A,top:A,bottom:A}}else this.margin=n.margin;this.scrollWhenOutside=n.scrollWhenOutside||!1;var O={},S=c(O),M=m(),F=!1;window.addEventListener("mousemove",S,!1),window.addEventListener("touchmove",S,!1),isNaN(n.maxSpeed)||(L=n.maxSpeed),"object"!=typeof L&&(L={left:L,right:L,top:L,bottom:L}),this.autoScroll=t(n.autoScroll),this.syncMove=t(n.syncMove,!1),this.destroy=function(t){window.removeEventListener("mousemove",S,!1),window.removeEventListener("touchmove",S,!1),window.removeEventListener("mousedown",u,!1),window.removeEventListener("touchstart",u,!1),window.removeEventListener("mouseup",l,!1),window.removeEventListener("touchend",l,!1),window.removeEventListener("pointerup",l,!1),window.removeEventListener("mouseleave",s,!1),window.removeEventListener("mousemove",p,!1),window.removeEventListener("touchmove",p,!1),window.removeEventListener("scroll",o,!0),e=[],t&&d()},this.add=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return i.apply(void 0,[e].concat(t)),this},this.remove=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return a.apply(void 0,[e].concat(t))};var K,q=null;"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),function(t){e=[],t.forEach(function(e){e===window?q=window:x.add(e)})}(e),Object.defineProperties(this,{down:{get:function(){return F}},maxSpeed:{get:function(){return L}},point:{get:function(){return O}},scrolling:{get:function(){return j}}});var N,C=null;window.addEventListener("mousedown",u,!1),window.addEventListener("touchstart",u,!1),window.addEventListener("mouseup",l,!1),window.addEventListener("touchend",l,!1),window.addEventListener("pointerup",l,!1),window.addEventListener("mousemove",p,!1),window.addEventListener("touchmove",p,!1),window.addEventListener("mouseleave",s,!1),window.addEventListener("scroll",o,!0)}function p(e,t){return new w(e,t)}function h(e,t,n){return n?e.y>n.top&&e.y<n.bottom&&e.x>n.left&&e.x<n.right:d(e,t)}var g=function(){var e=function(e){return"function"==typeof e},t=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t},n=Math.pow(2,53)-1,r=function(e){var r=t(e);return Math.min(Math.max(r,0),n)},o=function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}},i=function(t,n){if(null!=t&&null!=n){var r=t[n];if(null==r)return;if(!e(r))throw new TypeError(r+" is not a function");return r}},a=function(e){var t=e.next();return!Boolean(t.done)&&t};return function(t){var n,u=this,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!e(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}var l,f,d=i(t,o(t));if(void 0!==d){l=e(u)?Object(new u):[];var m=d.call(t);if(null==m)throw new TypeError("Array.from requires an array-like or iterable object");f=0;for(var s,v;;){if(!(s=a(m)))return l.length=f,l;v=s.value,l[f]=c?c.call(n,v,f):v,f++}}else{var w=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=r(w.length);l=e(u)?Object(new u(p)):new Array(p),f=0;for(var h;f<p;)h=w[f],l[f]=c?c.call(n,h,f):h,f++;l.length=p}return l}}(),y=("function"==typeof Array.from&&Array.from,Array.isArray,Object.prototype.toString,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}),b=function(e){return null!=e&&"object"===(void 0===e?"undefined":y(e))&&1===e.nodeType&&"object"===y(e.style)&&"object"===y(e.ownerDocument)},E=void 0;E="function"!=typeof Object.create?function(e){var t=function(){};return function(e,n){if(e!==Object(e)&&null!==e)throw TypeError("Argument must be an object, or null");t.prototype=e||{};var r=new t;return t.prototype=null,void 0!==n&&Object.defineProperties(r,n),null===e&&(r.__proto__=null),r}}():Object.create;var T=E,x=["altKey","button","buttons","clientX","clientY","ctrlKey","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","region","relatedTarget","screenX","screenY","shiftKey","which","x","y"],L=["webkit","moz","ms","o"],X=function(){if("undefined"==typeof window)return function(){};for(var e=0,t=L.length;e<t&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[L[e]+"RequestAnimationFrame"];if(!window.requestAnimationFrame){var n=0;window.requestAnimationFrame=function(e){var t=(new Date).getTime(),r=Math.max(0,16-t-n),o=window.setTimeout(function(){return e(t+r)},r);return n=t+r,o}}return window.requestAnimationFrame.bind(window)}(),Y=function(){if("undefined"==typeof window)return function(){};for(var e=0,t=L.length;e<t&&!window.cancelAnimationFrame;++e)window.cancelAnimationFrame=window[L[e]+"CancelAnimationFrame"]||window[L[e]+"CancelRequestAnimationFrame"];return window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){window.clearTimeout(e)}),window.cancelAnimationFrame.bind(window)}();return p}(); |
{ | ||
"name": "@mattlewis92/dom-autoscroller", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Auto scroll dom elements", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle.js", |
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
174622
1505