diff --git a/js/hopscotch-0.0.5.js b/js/hopscotch-0.0.5.js index e14e73b8..3cfbad00 100644 --- a/js/hopscotch-0.0.5.js +++ b/js/hopscotch-0.0.5.js @@ -1701,10 +1701,6 @@ loadTour.call(this, tour); } - if (typeof stepNum !== undefinedStr) { - currStepNum = stepNum; - } - // If document isn't ready, wait for it to finish loading. // (so that we can calculate positioning accurately) if (!utils.documentIsReady()) { @@ -1712,7 +1708,10 @@ return this; } - if (currTour.id === cookieTourId && typeof cookieTourStep !== undefinedStr) { + if (typeof stepNum !== undefinedStr) { + currStepNum = stepNum; + } + else if (currTour.id === cookieTourId && typeof cookieTourStep !== undefinedStr) { currStepNum = cookieTourStep; } else { diff --git a/js/hopscotch-0.0.5.min.js b/js/hopscotch-0.0.5.min.js index 8f50079b..51982c00 100644 --- a/js/hopscotch-0.0.5.min.js +++ b/js/hopscotch-0.0.5.min.js @@ -25,11 +25,11 @@ i=!1},100))});this.hide();b.documentIsReady()?(g.body.appendChild(e),q=b.support f)),b.addEvtListener(window,"load",f))}},F=function(){var a={};this.createCallout=function(b){var c;if(b.id){if(a[b.id])throw"Callout by that id already exists. Please choose a unique id.";b.showNextButton=b.showPrevButton=!1;b.isTourBubble=!1;c=new z(b);a[b.id]=c;b.target&&c.render(b,null,null,function(){c.show()})}else throw"Must specify a callout id.";return c};this.getCallout=function(b){return a[b]};this.removeAllCallouts=function(){for(var b in a)a.hasOwnProperty(b)&&this.removeCallout(b)}; this.removeCallout=function(b){var c=a[b];a[b]=null;c&&c.destroy()}},E=function(a){var e=this,c,d,h,i,f,l,j,q,x=function(){c||(c=new z({animate:h.animate,bubblePadding:h.bubblePadding,bubbleWidth:h.bubbleWidth,showNextButton:h.showNextButton,showPrevButton:h.showPrevButton,arrowWidth:h.arrowWidth}));return c},r=function(){return 0>f||f>=i.steps.length?null:i.steps[f]},w=function(){e.nextStep(!1)},B=function(a,c){var d,h;0<=f+a&&f+ae?d:e,f=b.getScrollTop(),e=f+b.getWindowHeight(),p=a-h.scrollTopMargin,i,I,u;a>= -f&&(a<=f+h.scrollTopMargin||d<=e)?j&&j():h.smoothScroll?"undefined"!==typeof YAHOO&&"undefined"!==typeof YAHOO.env&&"undefined"!==typeof YAHOO.env.ua&&"undefined"!==typeof YAHOO.util&&"undefined"!==typeof YAHOO.util.Scroll?(a=YAHOO.env.ua.webkit?g.body:g.documentElement,d=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:void 0,a=new YAHOO.util.Scroll(a,{scroll:{to:[0,p]}},h.scrollDuration/1E3,d),a.onComplete.subscribe(j),a.animate()):A?$("body, html").animate({scrollTop:p},h.scrollDuration,j):(0>p&&(p= -0),i=f>a?-1:1,I=Math.abs(f-p)/(h.scrollDuration/10),u=function(){var a=b.getScrollTop(),c=a+i*I;0=p||0>i&&c<=p?(c=p,j&&j(),window.scrollTo(0,c)):(window.scrollTo(0,c),b.getScrollTop()===a?j&&j():setTimeout(u,10))},u()):(window.scrollTo(0,p),j&&j())}else j();c.nextOnTargetClick&&b.addEvtListener(k,"click",w)});c.multipage&&(e+=":mp");b.setState(h.cookieName,e,1)},c.delay||0);return this};this.prevStep=function(a){y.call(this,a,-1);return this};this.nextStep=function(a){var c=r(),d=b.getStepTarget(c); +this.endTour(!0,!1);C.call(this,f)}return this};this.getCalloutManager=function(){"undefined"===typeof d&&(d=new F);return d};this.startTour=function(a,c){var d,g=this;if(!i){i=a;var e={},k;for(k in a)a.hasOwnProperty(k)&&("id"!==k&&"steps"!==k)&&(e[k]=a[k]);this.resetDefaultOptions();q.call(this,e,!0);if(e=b.getState(h.cookieName))e=e.split(":"),l=e[0],j=e[1],j=parseInt(j,10),2e?d:e,f=b.getScrollTop(),e=f+b.getWindowHeight(),p=a-h.scrollTopMargin,i,I,u;a>=f&&(a<=f+ +h.scrollTopMargin||d<=e)?j&&j():h.smoothScroll?"undefined"!==typeof YAHOO&&"undefined"!==typeof YAHOO.env&&"undefined"!==typeof YAHOO.env.ua&&"undefined"!==typeof YAHOO.util&&"undefined"!==typeof YAHOO.util.Scroll?(a=YAHOO.env.ua.webkit?g.body:g.documentElement,d=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:void 0,a=new YAHOO.util.Scroll(a,{scroll:{to:[0,p]}},h.scrollDuration/1E3,d),a.onComplete.subscribe(j),a.animate()):A?$("body, html").animate({scrollTop:p},h.scrollDuration,j):(0>p&&(p=0),i=f>a? +-1:1,I=Math.abs(f-p)/(h.scrollDuration/10),u=function(){var a=b.getScrollTop(),c=a+i*I;0=p||0>i&&c<=p?(c=p,j&&j(),window.scrollTo(0,c)):(window.scrollTo(0,c),b.getScrollTop()===a?j&&j():setTimeout(u,10))},u()):(window.scrollTo(0,p),j&&j())}else j();c.nextOnTargetClick&&b.addEvtListener(k,"click",w)});c.multipage&&(e+=":mp");b.setState(h.cookieName,e,1)},c.delay||0);return this};this.prevStep=function(a){y.call(this,a,-1);return this};this.nextStep=function(a){var c=r(),d=b.getStepTarget(c); c.nextOnTargetClick&&b.removeEvtListener(d,"click",w);y.call(this,a,1);return this};this.endTour=function(a,c){var d=x(),a=b.valOrDefault(a,!0),c=b.valOrDefault(c,!0);f=0;j=void 0;d.hide();a&&b.clearState(h.cookieName);m.isActive=!1;i&&c&&b.invokeEventCallbacks("end");m.removeCallbacks(!0);i=null;return this};this.getCurrTour=function(){return i};this.getCurrStepNum=function(){return f};this.listen=function(a,b,c){a&&s[a].push({cb:b,fromTour:c});return this};this.unlisten=function(a,b){var c=s[a], d,e;d=0;for(e=c.length;d