diff --git a/js/hopscotch-0.0.4.js b/js/hopscotch-0.0.4.js index b1b87aa2..191025ba 100644 --- a/js/hopscotch-0.0.4.js +++ b/js/hopscotch-0.0.4.js @@ -517,6 +517,9 @@ * @private */ this.closeFn = function(evt) { + if (self.opt.onClose) { + self.opt.onClose(); + } if (self.opt.id && !self.opt.isTourBubble) { // Remove via the HopscotchCalloutManager. // removeCallout() calls HopscotchBubble.destroy internally. diff --git a/js/hopscotch-0.0.4.min.js b/js/hopscotch-0.0.4.min.js index 65ee0fd5..f78fd3da 100644 --- a/js/hopscotch-0.0.4.min.js +++ b/js/hopscotch-0.0.4.min.js @@ -8,12 +8,12 @@ sessionStorage.removeItem(a):this.setState(a,"",-1)}},p={next:[],prev:[],start:[ c,d,f,h;d=b.getStepTarget(a);var g=this.element,i=this.arrowEl,j=b.getPixelValue(a.arrowOffset);e=b.getPixelValue(a.width)||this.opt.bubbleWidth;c=b.valOrDefault(a.padding,this.opt.bubblePadding);b.removeClass(g,"fade-in-down fade-in-up fade-in-left fade-in-right");d=d.getBoundingClientRect();"top"===a.orientation?(e=g.offsetHeight,f=d.top-e-this.opt.arrowWidth,h=d.left):"bottom"===a.orientation?(f=d.bottom+this.opt.arrowWidth,h=d.left):"left"===a.orientation?(f=d.top,h=d.left-e-2*c-12-this.opt.arrowWidth): "right"===a.orientation&&(f=d.top,h=d.right+this.opt.arrowWidth);if(j)if("top"===a.orientation||"bottom"===a.orientation)i.style.top="",i.style.left=j+"px";else{if("left"===a.orientation||"right"===a.orientation)i.style.left="",i.style.top=j+"px"}else i.style.top="",i.style.left="";h+=b.getPixelValue(a.xOffset);f+=b.getPixelValue(a.yOffset);a.fixedElement||(f+=b.getScrollTop(),h+=b.getScrollLeft());g.style.position=a.fixedElement?"fixed":"absolute";this.opt.animate&&x&&!B?$(g).animate({top:f+"px", left:h+"px"}):(g.style.top=f+"px",g.style.left=h+"px")},_initNavButtons:function(){var a=document.createElement("div");this.prevBtnEl=this._createButton("hopscotch-prev",l.prevBtn);this.nextBtnEl=this._createButton("hopscotch-next",l.nextBtn);this.doneBtnEl=this._createButton("hopscotch-done",l.doneBtn);b.addClass(this.doneBtnEl,"hide");a.appendChild(this.prevBtnEl);a.appendChild(this.nextBtnEl);a.appendChild(this.doneBtnEl);b.addClickListener(this.prevBtnEl,function(){i.prevStep(!0)});b.addClickListener(this.nextBtnEl, -function(){i.nextStep(!0)});b.addClickListener(this.doneBtnEl,i.endTour);a.className="hopscotch-actions";this.buttonsEl=a;this.containerEl.appendChild(a);return this},_getCloseFn:function(){var a=this;this.closeFn||(this.closeFn=function(e){a.opt.id&&!a.opt.isTourBubble?i.getCalloutManager().removeCallout(a.opt.id):a.destroy();b.evtPreventDefault(e)});return this.closeFn},initCloseButton:function(){var a=document.createElement("a");a.className="hopscotch-bubble-close";a.href="#";a.title=l.closeTooltip; -a.innerHTML=l.closeTooltip;this.opt.isTourBubble?b.addClickListener(a,function(a){var c=i.getCurrStepNum(),d=i.getCurrTour(),f=c===d.steps.length-1;b.invokeCallbacks("close",[d.id,c]);i.endTour(!0,f);a.preventDefault?a.preventDefault():event&&(event.returnValue=!1)}):b.addClickListener(a,this._getCloseFn());this.closeBtnEl=a;this.containerEl.appendChild(a);return this},_initArrow:function(){var a,b;this.arrowEl=document.createElement("div");this.arrowEl.className="hopscotch-bubble-arrow-container"; -b=document.createElement("div");b.className="hopscotch-bubble-arrow-border";a=document.createElement("div");a.className="hopscotch-bubble-arrow";this.arrowEl.appendChild(b);this.arrowEl.appendChild(a);this.element.appendChild(this.arrowEl);return this},render:function(a,e,c,d){var f=this.element,h,g;a?this.currStep=a:this.currStep&&(a=this.currStep);h=b.valOrDefault(a.showNextButton,this.opt.showNextButton);g=b.valOrDefault(a.showPrevButton,this.opt.showPrevButton);this.setTitle(a.title?a.title:""); -this.setContent(a.content?a.content:"");this.opt.showNumber&&this.setNum(e);this.orientation=a.orientation;this.opt.showNavButtons&&(this.showPrevButton(this.prevBtnEl&&g&&0