@odopod/odo-scroll-animation
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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";function t(){return"sa_"+(r+=1)}function e(t){return t&&t.window&&t.document&&t.location&&t.alert&&t.setInterval}function n(t){return t&&9===t.nodeType}var r=0,i={_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 n=void 0,r=void 0;return e(t)?(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,r){if("function"==typeof e&&(r=e,e=window),n(e)&&(e=window),!e||!e.addEventListener)throw new TypeError('OdoScrollAnimation: "'+e+'" is not an Element, Document, or Window');if("function"!=typeof r)throw new TypeError('OdoScrollAnimation: "'+r+'" is not a function');this._targets.has(e)||this._register(e);var i=t();return this._listeners.set(i,{target:e,fn:r}),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 i._onScroll=i._handleTargetScrolled.bind(i),i}); | ||
!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}); | ||
//# sourceMappingURL=odo-scroll-animation.min.js.map |
{ | ||
"name": "@odopod/odo-scroll-animation", | ||
"description": "Performant scroll listeners.", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "dist/odo-scroll-animation.js", | ||
@@ -32,3 +32,3 @@ "odoModule": "src/scroll-animation.js", | ||
"license": "MIT", | ||
"repository": "odopod/odo", | ||
"repository": "odopod/code-library", | ||
"scripts": { | ||
@@ -35,0 +35,0 @@ "test": "gulp code-quality test" |
@@ -26,2 +26,2 @@ # Odo Scroll Animation | ||
[permalink]: https://code.odopod.com/odo-scroll-animation/ | ||
[permalink]: http://code.odopod.com/odo-scroll-animation/ |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
0
32611