-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathback.min.js
2 lines (1 loc) · 869 Bytes
/
back.min.js
1
var WillianVeiga=WillianVeiga||{};WillianVeiga.Scroll=WillianVeiga.Scroll||{};(function(a){var b,d,e,i={},g,f,h,c;b={showLinkAfter:10};a.Back=function(l,j){var k;d=l;for(k in j){if(j.hasOwnProperty(k)){b[k]=j[k]}}e();g()};a.Back.prototype.bindEvents=function(){d.addEventListener("click",h);window.addEventListener("scroll",c);g()};a.Back.prototype.unbindEvents=function(){d.removeEventListener("click",h);window.removeEventListener("scroll",c);f()};e=function(){var j=window.getComputedStyle(d);i.position=j.getPropertyValue("position");i.display=j.getPropertyValue("display")};g=function(){var j=d.style;j.position="fixed";j.display="none"};f=function(){var j=d.style;j.position=i.position;j.display=i.display};h=function(j){j.preventDefault();window.scrollTo(0,0)};c=function(){d.style.display=this.scrollY>=b.showLinkAfter?"block":"none"}}(WillianVeiga.Scroll));0