@odopod/odo-scroll-animation
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.OdoScrollAnimation=e()}(this,function(){"use strict";var t=0;var e={_listeners:new Map,_targets:new Map,_getListenersForTarget:function(t){var e=[];return this._listeners.forEach(function(n){n.target===t&&e.push(n.fn)}),e},_getScrollPosition:function(t){var e,n=void 0,r=void 0;return(e=t)&&e.window&&e.document&&e.location&&e.alert&&e.setInterval?(n=window.pageYOffset,r=window.pageXOffset):(n=t.scrollTop,r=t.scrollLeft),{top:n,left:r}},_callListeners:function(t){for(var e=this._getScrollPosition(t),n=this._getListenersForTarget(t),r=0,i=n.length;r<i;r++)n[r](e.top,e.left);this._targets.set(t,null)},_handleTargetScrolled:function(t){var e=t.currentTarget;this._targets.get(e)&&cancelAnimationFrame(this._targets.get(e));var n=requestAnimationFrame(this._callListeners.bind(this,e));this._targets.set(e,n)},_register:function(t){t.addEventListener("scroll",this._onScroll,!1),this._targets.set(t,null)},_unregister:function(t){t.removeEventListener("scroll",this._onScroll,!1),this._targets.delete(t)},add:function(e,n){var r;if("function"==typeof e&&(n=e,e=window),(r=e)&&9===r.nodeType&&(e=window),!e||!e.addEventListener)throw new TypeError('OdoScrollAnimation: "'+e+'" is not an Element, Document, or Window');if("function"!=typeof n)throw new TypeError('OdoScrollAnimation: "'+n+'" is not a function');this._targets.has(e)||this._register(e);var i="sa_"+(t+=1);return this._listeners.set(i,{target:e,fn:n}),i},remove:function(t){var e=this._listeners.get(t);e&&(1===this._getListenersForTarget(e.target).length&&this._unregister(e.target),this._listeners.delete(t))}};return e._onScroll=e._handleTargetScrolled.bind(e),e}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.OdoScrollAnimation=e()}(this,function(){"use strict";var t=0;function e(){return"sa_"+(t+=1)}var n={_listeners:new Map,_targets:new Map,_getListenersForTarget:function(t){var e=[];return this._listeners.forEach(function(n){n.target===t&&e.push(n.fn)}),e},_getScrollPosition:function(t){var e,n=void 0,r=void 0;return(e=t)&&e.window&&e.document&&e.location&&e.alert&&e.setInterval?(n=window.pageYOffset,r=window.pageXOffset):(n=t.scrollTop,r=t.scrollLeft),{top:n,left:r}},_callListeners:function(t){for(var e=this._getScrollPosition(t),n=this._getListenersForTarget(t),r=0,i=n.length;r<i;r++)n[r](e.top,e.left);this._targets.set(t,null)},_handleTargetScrolled:function(t){var e=t.currentTarget;this._targets.get(e)&&cancelAnimationFrame(this._targets.get(e));var n=requestAnimationFrame(this._callListeners.bind(this,e));this._targets.set(e,n)},_register:function(t){t.addEventListener("scroll",this._onScroll,!1),this._targets.set(t,null)},_unregister:function(t){t.removeEventListener("scroll",this._onScroll,!1),this._targets.delete(t)},add:function(t,n){var r;if("function"==typeof t&&(n=t,t=window),(r=t)&&9===r.nodeType&&(t=window),!t||!t.addEventListener)throw new TypeError('OdoScrollAnimation: "'+t+'" is not an Element, Document, or Window');if("function"!=typeof n)throw new TypeError('OdoScrollAnimation: "'+n+'" is not a function');this._targets.has(t)||this._register(t);var i=e();return this._listeners.set(i,{target:t,fn:n}),i},remove:function(t){var e=this._listeners.get(t);e&&(1===this._getListenersForTarget(e.target).length&&this._unregister(e.target),this._listeners.delete(t))}};return n._onScroll=n._handleTargetScrolled.bind(n),n}); | ||
//# sourceMappingURL=odo-scroll-animation.min.js.map |
{ | ||
"name": "@odopod/odo-scroll-animation", | ||
"description": "Performant scroll listeners.", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"main": "dist/odo-scroll-animation.js", | ||
"module": "dist/odo-scroll-animation.esm.js", | ||
"odoModule": "src/scroll-animation.js", | ||
"sideEffects": false, | ||
"author": "Odopod", | ||
@@ -18,4 +20,3 @@ "contributors": [ | ||
"dist", | ||
"src", | ||
"index.js" | ||
"src" | ||
], | ||
@@ -22,0 +23,0 @@ "odoKeywords": [ |
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
48146
9
553