diff --git a/pace-theme-default.css b/pace-theme-default.css index d9405a1..04907b4 100644 --- a/pace-theme-default.css +++ b/pace-theme-default.css @@ -1,5 +1,5 @@ /*! - * pace.js v1.2.3 | Default theme + * pace.js v1.2.4 | Default theme * https://github.com/CodeByZach/pace/ * Licensed MIT © HubSpot, Inc. */ diff --git a/pace-theme-default.min.css b/pace-theme-default.min.css index 287907a..7c7404e 100644 --- a/pace-theme-default.min.css +++ b/pace-theme-default.min.css @@ -1,5 +1,5 @@ /*! - * pace.js v1.2.3 | Default theme + * pace.js v1.2.4 | Default theme * https://github.com/CodeByZach/pace/ * Licensed MIT © HubSpot, Inc. */ diff --git a/pace.js b/pace.js index 2038761..0831a47 100644 --- a/pace.js +++ b/pace.js @@ -1,5 +1,5 @@ /*! - * pace.js v1.2.3 + * pace.js v1.2.4 * https://github.com/CodeByZach/pace/ * Licensed MIT © HubSpot, Inc. */ @@ -49,7 +49,25 @@ cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame; addEventListener = function(obj, event, callback) { - return (typeof obj.addEventListener === "function" ? obj.addEventListener(event, callback, false) : void 0) || (obj["on" + event] = callback); + if (typeof obj.addEventListener === "function") { + return obj.addEventListener(event, callback, false); + } else { + return function() { + if (typeof obj["on" + event] !== "function" || typeof obj["on" + event].eventListeners !== "object") { + var eventListeners = new Events(); + if (typeof obj["on" + event] === "function") { + eventListeners.on(event, obj["on" + event]); + } + obj["on" + event] = function(evt) { + return eventListeners.trigger(event, evt); + }; + obj["on" + event].eventListeners = eventListeners; + } else { + var eventListeners = obj["on" + event].eventListeners; + } + eventListeners.on(event, callback); + }(); + } }; if (requestAnimationFrame == null) { diff --git a/pace.min.js b/pace.min.js index 40c74bd..b82e257 100644 --- a/pace.min.js +++ b/pace.min.js @@ -1,6 +1,6 @@ /*! - * pace.js v1.2.3 + * pace.js v1.2.4 * https://github.com/CodeByZach/pace/ * Licensed MIT © HubSpot, Inc. */ -(function(){function o(t,e){return function(){return t.apply(e,arguments)}}var u,c,i,n,y,t,l,v,r,s,a,e,p,w,b,h,f,d,g,m,k,S,q,x,L,P,T,R,j,O,E,M,A,C,N,_,F,U,W,X,D,H,I,z,G,B=[].slice,J={}.hasOwnProperty,K=function(t,e){for(var n in e)J.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},Q=[].indexOf||function(t){for(var e=0,n=this.length;e\n
\n\n
',null!=t.firstChild?t.insertBefore(this.el,t.firstChild):t.appendChild(this.el)}return this.el},Z.prototype.finish=function(){var t=this.getElement();return t.className=t.className.replace("pace-active","pace-inactive"),document.body.className=document.body.className.replace("pace-running ","pace-done ")},Z.prototype.update=function(t){return this.progress=t,y.trigger("progress",t),this.render()},Z.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(t){n=t}return this.el=void 0},Z.prototype.render=function(){var t,e,n,r,s,o,i;if(null==document.querySelector(P.target))return!1;for(t=this.getElement(),r="translate3d("+this.progress+"%, 0, 0)",s=0,o=(i=["webkitTransform","msTransform","transform"]).length;sP.eventLag.sampleCount&&o.shift(),e=p(o),++s>=P.eventLag.minSamples&&ethis.progress&&(this.progress+=this.catchup*t),e=1-Math.pow(this.progress/100,P.easeFactor),this.progress+=e*this.rate*t,this.progress=Math.min(this.lastProgress+P.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},v=ot,b=e=N=w=O=C=null,y.running=!1,S=function(){if(P.restartOnPushState)return y.restart()},null!=window.history.pushState&&(H=window.history.pushState,window.history.pushState=function(){return S(),H.apply(window.history,arguments)}),null!=window.history.replaceState&&(z=window.history.replaceState,window.history.replaceState=function(){return S(),z.apply(window.history,arguments)}),l={ajax:u,elements:G,document:K,eventLag:m},(x=function(){var t,e,n,r,s,o,i,a;for(y.sources=C=[],e=0,r=(o=["ajax","elements","document","eventLag"]).length;e\n
\n\n
',null!=t.firstChild?t.insertBefore(this.el,t.firstChild):t.appendChild(this.el)}return this.el},$.prototype.finish=function(){var t=this.getElement();return t.className=t.className.replace("pace-active","pace-inactive"),document.body.className=document.body.className.replace("pace-running ","pace-done ")},$.prototype.update=function(t){return this.progress=t,y.trigger("progress",t),this.render()},$.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(t){n=t}return this.el=void 0},$.prototype.render=function(){var t,e,n,r,s,o,i;if(null==document.querySelector(T.target))return!1;for(t=this.getElement(),r="translate3d("+this.progress+"%, 0, 0)",s=0,o=(i=["webkitTransform","msTransform","transform"]).length;sT.eventLag.sampleCount&&o.shift(),e=h(o),++s>=T.eventLag.minSamples&&ethis.progress&&(this.progress+=this.catchup*t),e=1-Math.pow(this.progress/100,T.easeFactor),this.progress+=e*this.rate*t,this.progress=Math.min(this.lastProgress+T.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},v=it,b=e=_=w=E=N=null,y.running=!1,q=function(){if(T.restartOnPushState)return y.restart()},null!=window.history.pushState&&(I=window.history.pushState,window.history.pushState=function(){return q(),I.apply(window.history,arguments)}),null!=window.history.replaceState&&(G=window.history.replaceState,window.history.replaceState=function(){return q(),G.apply(window.history,arguments)}),l={ajax:u,elements:k,document:B,eventLag:Q},(x=function(){var t,e,n,r,s,o,i,a;for(y.sources=N=[],e=0,r=(o=["ajax","elements","document","eventLag"]).length;e