From 9ce76e9938f8afca9efb06705e4453fea18ea4a3 Mon Sep 17 00:00:00 2001 From: louisameline Date: Sun, 22 May 2016 17:00:06 +0200 Subject: [PATCH] fixed #491 and #520 --- demo/index.html | 5 +- demo/style.css | 101 +++-- dist/js/tooltipster.bundle.js | 70 +++- dist/js/tooltipster.bundle.min.js | 4 +- dist/js/tooltipster.core.js | 60 ++- dist/js/tooltipster.core.min.js | 2 +- doc/images/tooltipster.svg | 392 +++++++++--------- doc/js/scripts.js | 1 - package.json | 2 +- src/js/core.js | 58 ++- src/js/plugins/tooltipster/sideTip/sideTip.js | 10 + 11 files changed, 408 insertions(+), 297 deletions(-) diff --git a/demo/index.html b/demo/index.html index 800f714..d6077fc 100644 --- a/demo/index.html +++ b/demo/index.html @@ -12,7 +12,7 @@ - + -
Google
@@ -199,6 +198,8 @@

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio placeat sunt quasi laudantium. Voluptatum consectetur voluptatem rem, sapiente, neque vero esse dicta veritatis accusamus! Obcaecati at in ad sit odio aliquid expedita quibusdam asperiores ducimus eos, tenetur quasi dolores quae iste quaerat, maxime consectetur!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio placeat sunt quasi laudantium. Voluptatum consectetur tempor voluptatem rem, sapiente, neque vero esse dicta veritatis accusamus reprehenderit eos deserunt eleifend! Obcaecati at in ad sit odio aliquid expedita quibusdam asperiores ducimus eos, tenetur quasi dolores quae iste quaerat, maxime consectetur!

Quasi consequuntur aut, mollitia, tempore exercitationem rerum neque ad, expedita deserunt dolores alias
quae assumenda id facere cum laudantium tenetur corrupti ipsam deleniti quas eveniet ratione sit nulla officia recusandae.

+ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio placeat sunt quasi laudantium. Voluptatum consectetur tempor voluptatem rem, sapiente, neque vero esse dicta veritatis accusamus reprehenderit eos deserunt eleifend! Obcaecati at in ad sit odio aliquid expedita quibusdam asperiores ducimus eos, tenetur quasi dolores quae iste quaerat, maxime consectetur!

diff --git a/demo/style.css b/demo/style.css index fd28e0b..17a72c9 100644 --- a/demo/style.css +++ b/demo/style.css @@ -1,54 +1,49 @@ -/* Main */ - -body { - background-color: #dcdcdc; - color: #0b0b0b; - font-size: 16px; - line-height: 22px; -} - -.container, #container { - width: 978px; - margin: 10px auto; - padding: 60px; - box-shadow: 0px 0px 10px rgba(0,0,0,0.2); - background: #fff; - text-align: left; - display: block; - overflow: hidden; -} - -.inline:hover { - background: khaki; -} - -.item { - width: 200px; - float: left; - padding: 10px; - margin: 10px; - background: #000; - color: #fff; -} - -#genderChart1 { - height: 300px; - width: 300px; - margin: 0 auto; -} - -#inline_container p { - margin: auto; - width: 300px; -} - -#scrollable { - height: 300px; - overflow: scroll; -} - -#scrollable2 { - border: 1px solid gray; - height: 250px; - overflow: scroll; +/* Main */ + +body { + background-color: #dcdcdc; + font-size: 16px; + line-height: 22px; +} + +.container, #container { + width: 978px; + margin: 10px auto; + padding: 60px; + box-shadow: 0px 0px 10px rgba(0,0,0,0.2); + background: #fff; + text-align: left; + display: block; + overflow: hidden; +} + +.item { + width: 200px; + float: left; + padding: 10px; + margin: 10px; + background: #000; + color: #fff; +} + +#genderChart1 { + height: 300px; + width: 300px; + margin: 0 auto; +} + +#inline_container p { + margin: auto; + width: 300px; +} + +#scrollable { + height: 300px; + overflow: scroll; +} + +#scrollable2 { + border: 1px solid gray; + height: 250px; + overflow: scroll; } \ No newline at end of file diff --git a/dist/js/tooltipster.bundle.js b/dist/js/tooltipster.bundle.js index 1e57b6d..27c82e8 100644 --- a/dist/js/tooltipster.bundle.js +++ b/dist/js/tooltipster.bundle.js @@ -54,7 +54,7 @@ // collects plugins in their bare object form plugins = {}, // don't set manually, it will be updated by Grunt after the manifest - semVer = '4.0.0rc43'; + semVer = '4.0.0rc44'; // global methods @@ -284,6 +284,8 @@ this.geometry; // proxy the variable for display plugins who may use it this.IE = IE; + // to fix a touch issue + this.ignoreNextClick = false; this.mouseIsOverOrigin = false; // a unique namespace per instance this.namespace = 'tooltipster-'+ Math.round(Math.random()*100000); @@ -294,7 +296,7 @@ this.$originParents; // to remove themes if needed this.previousThemes = []; - // the state can be either : appearing, stable, disappearing, closed + // the state can be either: appearing, stable, disappearing, closed this.state = 'closed'; // timeout references this.timeouts = { @@ -325,7 +327,7 @@ // some options may need to be reformatted self._optionsFormat(); - // note : the content is null (empty) by default and can stay that + // note: the content is null (empty) by default and can stay that // way if the plugin remains initialized but not fed any content. The // tooltip will just not appear. @@ -347,7 +349,7 @@ // If content is provided in the options, it has precedence over the // title attribute. - // Note : an empty string is considered content, only 'null' represents + // Note: an empty string is considered content, only 'null' represents // the absence of content. // Also, an existing title="" attribute will result in an empty string // content @@ -634,7 +636,7 @@ // clone if asked. Cloning the object makes sure that each instance has its // own version of the content (in case a same object were provided for several // instances) - // reminder : typeof null === object + // reminder: typeof null === object if (content instanceof $ && this.options.contentCloning) { content = content.clone(true); } @@ -1018,8 +1020,11 @@ var self = this; - // if the destruction process has not begun - if (!self.destroying) { + // if the destruction process has not begun and if this was not + // triggered by an unwanted emulated click event + if ( !self.destroying + && (!event || !self.ignoreNextClick) + ) { // check that the origin is still in the DOM if (bodyContains(self.$origin)) { @@ -1233,7 +1238,7 @@ // if the user touches the body, close if (deviceHasTouchCapability) { - // timeout 0 : to prevent immediate closing if the method was called + // timeout 0: to prevent immediate closing if the method was called // on a click event and if options.delay == 0 (because of bubbling) setTimeout(function() { @@ -1298,14 +1303,37 @@ // to close the tooltip if (self.options.triggerClose.click) { - // explanations : same as above + // explanations: same as above setTimeout(function() { if (self.state != 'closed') { $('body').on('click.'+ self.namespace +'-triggerClose touchstart.'+ self.namespace +'-triggerClose', function(event) { if (!self.options.interactive || !$.contains(self.$tooltip[0], event.target)) { + self._close(event); + + // the touchstart event is about to be emulated into a click event. But now the + // tooltip is closed, if this emulated click happens on the origin, it will open + // the tooltip again right away (at least in Safari, not sure why the other + // browsers decide not to reopen it). We could call event.preventDefault() to + // prevent the emulation but it could also prevent browser normal behaviors like + // scrolling or zooming, so we'll let the click be triggered and just ignore it + // in ::_openNow() + if ( event.type == 'touchstart' + && ( self.$origin[0] === event.target + || $.contains(self.$origin[0], event.target) + ) + ) { + + self.ignoreNextClick = true; + + // the emulated click is triggered a crazy long time after the touch event, + // at least on an iPhone4 + setTimeout(function() { + self.ignoreNextClick = false; + }, 500); + } } }); } @@ -1410,9 +1438,9 @@ // in case we're resetting the triggers self.$origin.off('.'+ self.namespace +'-triggerOpen'); - // for 'click' and 'hover' open triggers : bind on events to open the tooltip. + // for 'click' and 'hover' open triggers: bind on events to open the tooltip. // Closing is now handled in _openNow() because of its bindings. - // Notes about touch events : + // Notes about touch events: // - mouseenter, mouseleave and clicks happen even on pure touch devices // because they are emulated. deviceIsPureTouch() is a simple attempt // to detect them. @@ -1443,8 +1471,8 @@ if (self.options.triggerOpen.click) { - // note : for touch devices, we do not bind on touchstart, we only rely - // on the emulated clicks (triggered by taps) + // note: for touch devices, we do not bind on touchstart, we only rely + // on the emulated clicks (emulated after touchstart) self.$origin.on('click.'+ self.namespace +'-triggerOpen', function(event) { if (!deviceIsPureTouch() || self.options.touchDevices) { self._openNow(event); @@ -2172,7 +2200,7 @@ // for using in closures var args = Array.prototype.slice.apply(arguments), - // common mistake : an HTML element can't be in several tooltips at the same time + // common mistake: an HTML element can't be in several tooltips at the same time contentCloningWarning = 'You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.'; // this happens with $(sel).tooltipster(...) when $(sel) does not match anything @@ -2347,7 +2375,7 @@ /** * Move the tooltip into an invisible div that does not allow overflow to make - * size tests. Note : the tooltip may or may not be attached to the DOM at the + * size tests. Note: the tooltip may or may not be attached to the DOM at the * moment this method is called, it does not matter. */ _init: function() { @@ -2370,7 +2398,7 @@ */ _forceRedraw: function() { - // note : this would work but for Webkit only + // note: this would work but for Webkit only //this.$tooltip.close(); //this.$tooltip[0].offsetHeight; //this.$tooltip.open(); @@ -3321,6 +3349,16 @@ var target, rects = this.instance.$origin[0].getClientRects(); + // these lines fix a Chrome bug (issue #491) + if (rects.length > 1) { + var opacity = this.instance.$origin.css('opacity'); + if(opacity == 1) { + this.instance.$origin.css('opacity', 0.99); + rects = this.instance.$origin[0].getClientRects(); + this.instance.$origin.css('opacity', 1); + } + } + // by default, the target will be the middle of the origin if (rects.length < 2) { diff --git a/dist/js/tooltipster.bundle.min.js b/dist/js/tooltipster.bundle.min.js index 84f60e9..92e132b 100644 --- a/dist/js/tooltipster.bundle.min.js +++ b/dist/js/tooltipster.bundle.min.js @@ -1,2 +1,2 @@ -/*! tooltipster v4.0.0rc43 */!function(a){function b(a){this.$container,this.constraints=null,this.$tooltip=a,this._init()}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c="string"==typeof b?b:b.attr("id");return c?!!document.getElementById(c):a.contains(document.body,b[0])}function e(){return!m&&n}function f(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e0?e=k[d]:a.each(k,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");if(k[b.name]=b,b.global){var f=function(){};f.prototype=b.global;var e=new f;c[b.name]=e,e._init&&e._init(c),c._bridge(b.global,e,c,b.name)}return this},setDefaults:function(b){return a.extend(h,b),!0},triggerHandler:function(){return i.triggerHandler.apply(i,Array.prototype.slice.apply(arguments)),this},version:function(){return l}},a.tooltipster=new g,a.Tooltipster=function(b,c){this.callbacks={close:[],open:[]},this.closingTime,this.Content,this.contentBcr,this.destroyed=!1,this.destroying=!1,this.$emitterPrivate=a({}),this.$emitterPublic=a({}),this.enabled=!0,this.garbageCollector,this.geometry,this.IE=p,this.mouseIsOverOrigin=!1,this.namespace="tooltipster-"+Math.round(1e5*Math.random()),this.options,this.$origin,this.$originParents,this.previousThemes=[],this.state="closed",this.timeouts={close:[],open:null},this.$tooltip,this.tracker=null,this.tooltipCoord,this._init(b,c)},a.Tooltipster.prototype={_init:function(b,c){var d=this;d.$origin=a(b),d.options=a.extend(!0,{},h,c),d._optionsFormat();var e=null;if(void 0===d.$origin.data("tooltipster-initialTitle")&&(e=d.$origin.attr("title"),void 0===e&&(e=null),d.$origin.data("tooltipster-initialTitle",e)),null!==d.options.content?d._contentSet(d.options.content):d._contentSet(e),d.$origin.removeAttr("title").addClass("tooltipstered"),!d.$origin.hasClass("tooltipstered")){var f=d.$origin.attr("class")||"";-1==f.indexOf("tooltipstered")&&d.$origin.attr("class",f+" tooltipstered")}d._prepareOrigin(),d._prepareGC(),a.each(d.options.plugins,function(b,c){var e=a.tooltipster.plugin(c);if(!e)throw new Error('The "'+c+'" plugin is not defined');if(e.instance){var f=function(){};f.prototype=e.instance;var g=new f;g._init(d),a.tooltipster._bridge(e.instance,g,d,e.name)}}),d._on("created",function(){d._prepareTooltip()})._on("repositioned",function(a){d.tooltipCoord=a.position})},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.destroying){c&&d.callbacks.close.push(c),d.callbacks.open=[],d._timeoutsClear();var g=function(){a.each(d.callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d.$origin[0]})}),d.callbacks.close=[]};if("closed"!=d.state){var h=!0,i=new Date,j=i.getTime(),k=j+d.options.animationDuration[1];if("disappearing"==d.state&&k>d.closingTime&&(h=!1),h){d.closingTime=k,"disappearing"!=d.state&&d._stateSet("disappearing");var l=function(){clearInterval(d.tracker),d._trigger({type:"closing",event:b}),d.$tooltip.off("."+d.namespace+"-triggerClose").removeClass("tooltipster-dying"),a(window).off("."+d.namespace+"-triggerClose"),d.$originParents.each(function(b,c){a(c).off("scroll."+d.namespace+"-triggerClose")}),d.$originParents=null,a("body").off("."+d.namespace+"-triggerClose"),d.$origin.off("."+d.namespace+"-triggerClose"),d._stateSet("closed"),d._trigger({type:"after",event:b}),d.options.functionAfter&&d.options.functionAfter.call(d,d,{event:b,origin:d.$origin[0]}),g()};f()?(d.$tooltip.css({"-moz-animation-duration":d.options.animationDuration[1]+"ms","-ms-animation-duration":d.options.animationDuration[1]+"ms","-o-animation-duration":d.options.animationDuration[1]+"ms","-webkit-animation-duration":d.options.animationDuration[1]+"ms","animation-duration":d.options.animationDuration[1]+"ms","transition-duration":d.options.animationDuration[1]+"ms"}),d.$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.options.animationDuration[1]>0&&d.$tooltip.delay(d.options.animationDuration[1]),d.$tooltip.queue(l)):d.$tooltip.stop().fadeOut(d.options.animationDuration[1],l)}}else g()}return d},_contentInsert:function(){var a=this,b=a.$tooltip.find(".tooltipster-content"),c=a.Content,d=function(a){c=a};a._trigger({type:"format",content:a.Content,format:d}),a.options.functionFormat&&(c=a.options.functionFormat.call(a,a,{origin:a.$origin[0]},a.Content)),"string"!=typeof c||a.options.contentAsHTML?b.empty().append(c):b.text(c)},_contentSet:function(b){b instanceof a&&this.options.contentCloning&&(b=b.clone(!0)),this.Content=b,this._trigger({type:"updated",content:b})},_destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},_geometry:function(){var b=this,c=b.$origin,d=b.$origin.is("area");if(d){var e=b.$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(document),h=a(window),i=c,j={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:window.scrollX||document.documentElement.scrollLeft,top:window.scrollY||document.documentElement.scrollTop},size:{height:h.height(),width:h.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var k=b.$origin.attr("shape"),l=b.$origin.attr("coords");if(l&&(l=l.split(","),a.map(l,function(a,b){l[b]=parseInt(a)})),"default"!=k)switch(k){case"circle":var m=l[0],n=l[1],o=l[2],p=n-o,q=m-o;j.origin.size.height=2*o,j.origin.size.width=j.origin.size.height,j.origin.windowOffset.left+=q,j.origin.windowOffset.top+=p;break;case"rect":var r=l[0],s=l[1],t=l[2],u=l[3];j.origin.size.height=u-s,j.origin.size.width=t-r,j.origin.windowOffset.left+=r,j.origin.windowOffset.top+=s;break;case"poly":for(var v=0,w=0,x=0,y=0,z="even",A=0;Ax&&(x=B,0===A&&(v=x)),v>B&&(v=B),z="odd"):(B>y&&(y=B,1==A&&(w=y)),w>B&&(w=B),z="even")}j.origin.size.height=y-w,j.origin.size.width=x-v,j.origin.windowOffset.left+=v,j.origin.windowOffset.top+=w}}if(window.SVGElement&&c[0]instanceof SVGElement&&SVG.svgjs){SVG.parser||SVG.prepare();var C=SVG.adopt(c[0]);if(C&&C.screenBBox){var D=C.screenBBox();j.origin.size.height=D.height,j.origin.size.width=D.width,j.origin.windowOffset.left=D.x,j.origin.windowOffset.top=D.y}}var E=function(a){j.origin.size.height=a.height,j.origin.windowOffset.left=a.left,j.origin.windowOffset.top=a.top,j.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:E,geometry:{height:j.origin.size.height,left:j.origin.windowOffset.left,top:j.origin.windowOffset.top,width:j.origin.size.width}}),j.origin.windowOffset.right=j.origin.windowOffset.left+j.origin.size.width,j.origin.windowOffset.bottom=j.origin.windowOffset.top+j.origin.size.height,j.origin.offset.left=j.origin.windowOffset.left+window.scrollX,j.origin.offset.top=j.origin.windowOffset.top+window.scrollY,j.origin.offset.bottom=j.origin.offset.top+j.origin.size.height,j.origin.offset.right=j.origin.offset.left+j.origin.size.width,j.available.document={bottom:{height:j.document.size.height-j.origin.offset.bottom,width:j.document.size.width},left:{height:j.document.size.height,width:j.origin.offset.left},right:{height:j.document.size.height,width:j.document.size.width-j.origin.offset.right},top:{height:j.origin.offset.top,width:j.document.size.width}},j.available.window={bottom:{height:Math.max(j.window.size.height-Math.max(j.origin.windowOffset.bottom,0),0),width:j.window.size.width},left:{height:j.window.size.height,width:Math.max(j.origin.windowOffset.left,0)},right:{height:j.window.size.height,width:Math.max(j.window.size.width-Math.max(j.origin.windowOffset.right,0),0)},top:{height:Math.max(j.origin.windowOffset.top,0),width:j.window.size.width}};"html"!=i[0].tagName.toLowerCase();){if("fixed"==i.css("position")){j.origin.fixedLineage=!0;break}i=i.parent()}return j},_off:function(){return this.$emitterPrivate.off.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.$emitterPrivate.on.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(a){var b=this,c=!0;"stable"!=b.state&&"appearing"!=b.state&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c&&(b.options.delay[0]?b.timeouts.open=setTimeout(function(){b.mouseIsOverOrigin&&b._openNow(a)},b.options.delay[0]):b._openNow(a)))},_openNow:function(b,c){var e=this;if(!e.destroying&&d(e.$origin)){var g=!0;if(e._trigger({type:"before",event:b,stop:function(){g=!1}}),g&&e.options.functionBefore&&(g=e.options.functionBefore.call(e,e,{event:b,origin:e.$origin[0]})),g!==!1&&e.enabled&&null!==e.Content){c&&e.callbacks.open.push(c),e.callbacks.close=[],e._timeoutsClear();var h,i=function(){"stable"!=e.state&&e._stateSet("stable"),a.each(e.callbacks.open,function(a,b){b.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}),e.callbacks.open=[]};if("closed"!==e.state)h=0,"disappearing"===e.state?(e._stateSet("appearing"),f()?(e.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i)):e.$tooltip.stop().fadeIn(i)):"stable"==e.state&&i();else{if(e._stateSet("appearing"),h=e.options.animationDuration[0],e.$tooltip.css({height:0,left:0,top:0,overflow:"hidden",width:0,zIndex:e.options.zIndex}),e._contentInsert(),e.reposition(b,!0),f()?(e.$tooltip.addClass("tooltipster-"+e.options.animation).addClass("tooltipster-initial"),e.$tooltip.css({"-moz-animation-duration":e.options.animationDuration[0]+"ms","-ms-animation-duration":e.options.animationDuration[0]+"ms","-o-animation-duration":e.options.animationDuration[0]+"ms","-webkit-animation-duration":e.options.animationDuration[0]+"ms","animation-duration":e.options.animationDuration[0]+"ms","transition-duration":e.options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.state&&(e.$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i))},0)):e.$tooltip.css("display","none").fadeIn(e.options.animationDuration[0],i),e._trackerStart(),a(window).on("resize."+e.namespace+"-triggerClose",function(a){e.reposition(a)}).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)}),e.$originParents=e.$origin.parents(),e.$originParents.each(function(b,c){a(c).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)})}),e.options.triggerClose.mouseleave){n&&setTimeout(function(){"closed"!=e.state&&a("body").on("touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||e._close()})},0);var j=e.$origin,k=null;e.options.interactive&&(j=j.add(e.$tooltip)),j.on("mouseleave."+e.namespace+"-triggerClose",function(a){e.options.delay[1]?(k=setTimeout(function(){e._close(a)},e.options.delay[1]),e.timeouts.close.push(k)):e._close(a)}).on("mouseenter."+e.namespace+"-triggerClose",function(){clearTimeout(k)})}e.options.triggerClose.originClick&&e.$origin.on("click."+e.namespace+"-triggerClose",function(a){e._close(a)}),e.options.triggerClose.click&&setTimeout(function(){"closed"!=e.state&&a("body").on("click."+e.namespace+"-triggerClose touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||e._close(b)})},0),e._trigger("ready"),e.options.functionReady&&e.options.functionReady.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}if(e.options.timer>0){var k=setTimeout(function(){e._close()},e.options.timer+h);e.timeouts.close.push(k)}}}},_optionsFormat:function(){"number"==typeof this.options.delay&&(this.options.delay=[this.options.delay,this.options.delay]),"number"==typeof this.options.animationDuration&&(this.options.animationDuration=[this.options.animationDuration,this.options.animationDuration]),"string"==typeof this.options.theme&&(this.options.theme=[this.options.theme]),"string"==typeof this.options.parent&&(this.options.parent=a(this.options.parent)),"hover"==this.options.trigger?(this.options.triggerOpen={hover:!0},this.options.triggerClose={mouseleave:!0,originClick:!0}):"click"==this.options.trigger&&(this.options.triggerOpen={click:!0},this.options.triggerClose={click:!0}),this._trigger("options")},_prepareGC:function(){var a=this;a.options.selfDestruction?a.garbageCollector=setInterval(function(){d(a.$origin)||a.destroy()},2e4):clearInterval(a.garbageCollector)},_prepareOrigin:function(){var a=this;a.$origin.off("."+a.namespace+"-triggerOpen"),a.options.triggerOpen.hover&&(a.$origin.on("mouseenter."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!0,a._open(b))}),n&&a.options.touchDevices&&a.$origin.on("touchstart."+a.namespace+"-triggerOpen",function(b){a._openNow(b)})),a.options.triggerOpen.click&&a.$origin.on("click."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||a._openNow(b)}),a.options.triggerClose.mouseleave&&a.$origin.on("mouseleave."+a.namespace+"-triggerOpen",function(){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!1)})},_prepareTooltip:function(){var b=this;b.$tooltip.attr("id",b.namespace),a.each(b.previousThemes,function(a,c){b.$tooltip.removeClass(c)}),a.each(b.options.theme,function(a,c){b.$tooltip.addClass(c)}),b.previousThemes=a.merge([],b.options.theme);var c=b.options.interactive?"auto":"";b.$tooltip.css("pointer-events",c)},_scrollHandler:function(b){var c=this;if(c.options.triggerClose.scroll)c._close(b);else{if(b.target===document)c.geometry.origin.fixedLineage||c.options.repositionOnScroll&&c.reposition(b);else{var d=c._geometry(),e=!1;if("fixed"!=c.$origin.css("position")&&c.$originParents.each(function(b,c){var f=a(c),g=f.css("overflow-x"),h=f.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(d.origin.windowOffset.lefti.right))return e=!0,!1;if("visible"!=h&&(d.origin.windowOffset.topi.bottom))return e=!0,!1}return"fixed"==f.css("position")?!1:void 0}),e)c.$tooltip.css("visibility","hidden");else if(c.$tooltip.css("visibility","visible"),c.options.repositionOnScroll)c.reposition(b);else{var f=d.origin.offset.left-c.geometry.origin.offset.left,g=d.origin.offset.top-c.geometry.origin.offset.top;c.$tooltip.css({left:c.tooltipCoord.left+f,top:c.tooltipCoord.top+g})}}c._trigger({type:"scroll",event:b})}},_stateSet:function(a){return this.state=a,this._trigger({type:"state",state:a}),this},_timeoutsClear:function(){clearTimeout(this.timeouts.open),this.timeouts.open=null,a.each(this.timeouts.close,function(a,b){clearTimeout(b)}),this.timeouts.close=[]},_trackerStart:function(){var a=this,b=a.$tooltip.find(".tooltipster-content");a.options.trackTooltip&&(a.contentBcr=b[0].getBoundingClientRect()),a.tracker=setInterval(function(){if(d(a.$origin)&&d(a.namespace)){if(a.options.trackOrigin){var e=a._geometry(),f=!1;c(e.origin.size,a.geometry.origin.size)&&(a.geometry.origin.fixedLineage?c(e.origin.windowOffset,a.geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.geometry.origin.offset)&&(f=!0)),f||(a.options.triggerClose.mouseleave?a._close():a.reposition())}if(a.options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.contentBcr.height&&g.width===a.contentBcr.width||(a.reposition(),a.contentBcr=g)}}else a._close()},a.options.trackerInterval)},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),a[0].instance=this,a[0].origin=this.$origin?this.$origin[0]:null,this.$emitterPrivate.trigger.apply(this.$emitterPrivate,a),i.trigger.apply(i,a),this.$emitterPublic.trigger.apply(this.$emitterPublic,a),this},_update:function(a){var b=this;if(b._contentSet(a),null!==b.Content){if("closed"!==b.state&&(b._contentInsert(),b.reposition(),b.options.updateAnimation))if(f()){var c=b.options.updateAnimation;b.$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.state&&b.$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b.$tooltip.fadeTo(200,.5,function(){"closed"!=b.state&&b.$tooltip.fadeTo(200,1)})}else b._close()},close:function(a){return this.destroyed?this._destroyError():this._close(null,a),this},content:function(a){return void 0===a?this.Content:(this.destroyed?this._destroyError():this._update(a),this)},destroy:function(){var b=this;return b.destroyed?b._destroyError():b.destroying||(b.destroying=!0,b._close(null,function(){b.destroying=!1,b.destroyed=!0,b._trigger("destroyed"),b._off(),b.off(),b.$origin.removeData(b.namespace).off("."+b.namespace+"-triggerOpen");var c=b.$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;if("previous"===b.options.restoration?d=b.$origin.data("tooltipster-initialTitle"):"current"===b.options.restoration&&(d="string"==typeof b.Content?b.Content:a("
").append(b.Content).html()),d&&b.$origin.attr("title",d),b.$origin.hasClass("tooltipstered"))b.$origin.removeClass("tooltipstered");else{var e=b.$origin.attr("class").replace("tooltipstered","");b.$origin.attr("class",e)}b.$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.namespace}),b.$origin.data("tooltipster-ns",c);b.Content=null,b.$origin=null,b.$emitterPrivate=null,b.$emitterPublic=null,b.$tooltip=null,b.options.parent=null,j=a.grep(j,function(a,c){return b!==a}),clearInterval(b.garbageCollector)})),b},disable:function(){return this.destroyed?void this._destroyError():(this._close(),this.enabled=!1,this)},elementOrigin:function(){return this.destroyed?void this._destroyError():this.$origin[0]},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:null},enable:function(){return this.enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.destroyed||this.$emitterPublic.off.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.destroyed?this._destroyError():this.$emitterPublic.on.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.destroyed?this._destroyError():this.$emitterPublic.one.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.destroyed||this.destroying?this._destroyError():this._openNow(null,a),this},option:function(b,c){return void 0===c?this.options[b]:(this.destroyed?this._destroyError():(this.options[b]=c,this._optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this._prepareOrigin(),"selfDestruction"===b&&this._prepareGC()),this)},reposition:function(a,b){var c=this;return c.destroyed?c._destroyError():(d(c.namespace)||b)&&(b||c.$tooltip.detach(),c.geometry=c._geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.destroyed,destroying:this.destroying,enabled:this.enabled,open:"closed"!==this.state,state:this.state}},triggerHandler:function(){return this.destroyed?this._destroyError():this.$emitterPublic.triggerHandler.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&"object"==typeof b[1]&&null!==b[1]&&!f.options.contentCloning&&f.options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}j=[];var e=b[0]&&void 0!==b[0].multiple,f=e&&b[0].multiple||!e&&h.multiple,g=b[0]&&void 0!==b[0].content,i=g&&b[0].content||!g&&h.content,k=b[0]&&void 0!==b[0].contentCloning,l=k&&b[0].contentCloning||!k&&h.contentCloning,m=b[0]&&void 0!==b[0].debug,n=m&&b[0].debug||!m&&h.debug;return this.length>1&&"object"==typeof i&&null!==i&&!l&&n&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),g=null;e?f?c=!0:n&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(g=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(g.namespace),d.data("tooltipster-ns",e),d.data(g.namespace,g),g.options.functionInit&&g.options.functionInit.call(g,g,{origin:this}),g._trigger("init")),j.push(g)}),this},b.prototype={_init:function(){this.$container=a('
').append(this.$tooltip).appendTo("body"),this.$tooltip.find(".tooltipster-content").css("overflow","auto")},_forceRedraw:function(){var a=this.$tooltip.parent();this.$tooltip.detach(),this.$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.$tooltip.css({display:"block",height:"",left:0,overflow:"auto",top:0,width:a}),this},destroy:function(){this.$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.$tooltip.css({display:"",height:"",left:0,overflow:"visible",top:0,width:""}),this},measure:function(){this._forceRedraw();var a=this.$tooltip[0].getBoundingClientRect(),b={size:{height:a.bottom,width:a.right}};if(this.constraints){var c=this.$tooltip.find(".tooltipster-content"),d=this.$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return p&&11>=p&&(b.size.width=Math.ceil(b.size.width)+1),b}};var m=!1;a("body").one("mousemove",function(){m=!0});var n=!!("ontouchstart"in window),o=navigator.userAgent.toLowerCase(),p=!1;-1!=o.indexOf("msie")?p=parseInt(o.split("msie")[1]):-1!==o.toLowerCase().indexOf("trident")&&-1!==o.indexOf(" rv:11")?p=11:-1!=o.toLowerCase().indexOf("edge/")&&(p=parseInt(o.toLowerCase().split("edge/")[1]))}(jQuery),function(a){a.tooltipster.plugin({name:"tooltipster.sideTip",instance:{_defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,side:"top"}},_init:function(a){var b=this;b.instance=a,b.options,b.previousState="closed",b._optionsFormat(),b.instance._on("state",function(a){"closed"==a.state?b._close():"appearing"==a.state&&"closed"==b.previousState&&b._create(),b.previousState=a.state}),b.instance._on("options",function(){b._optionsFormat()}),b.instance._on("reposition",function(a){b._reposition(a.event,a.helper)})},_close:function(){"object"==typeof this.instance.Content&&null!==this.instance.Content&&this.instance.Content.detach(),this.instance.$tooltip.remove()},_create:function(){var b=a('
');this.options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.options.minWidth&&b.css("min-width",this.options.minWidth+"px"),this.options.maxWidth&&b.css("max-width",this.options.maxWidth+"px"),this.instance.$tooltip=b,this.instance.$tooltip.appendTo(this.options.parent),this.instance._trigger("created")},_optionsFormat:function(){var b=this._defaults();if(this.options=a.extend(!0,{},b,this.instance.options),this.options.position&&(this.options.side=this.options.position),"object"==typeof this.instance.options.side&&(this.options.side=this.instance.options.side),"object"!=typeof this.options.distance&&(this.options.distance=[this.options.distance]),this.options.distance.length<4&&(void 0===this.options.distance[1]&&(this.options.distance[1]=this.options.distance[0]),void 0===this.options.distance[2]&&(this.options.distance[2]=this.options.distance[0]),void 0===this.options.distance[3]&&(this.options.distance[3]=this.options.distance[1]),this.options.distance={top:this.options.distance[0],right:this.options.distance[1],bottom:this.options.distance[2],left:this.options.distance[3]}),"string"==typeof this.options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};this.options.side=[this.options.side,c[this.options.side]],"left"==this.options.side[0]||"right"==this.options.side[0]?this.options.side.push("top","bottom"):this.options.side.push("right","left")}6===this.instance.IE&&this.options.arrow!==!0&&(this.options.arrow=!1)},_reposition:function(b,c){var d,e=this,f={document:{},window:{}},g=a.tooltipster._getRuler(e.instance.$tooltip);switch(a.each(["window","document"],function(b,d){for(var h=!1,b=0;b=e.options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.options.minIntersection:c.geo.origin.windowOffset.bottom>=e.options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.options.minIntersection,"natural"==b?c.geo.available[d][j].width>=o.width&&c.geo.available[d][j].height>=o.height&&(l=!0,naturalFits=!0):(l=n.fits,l&&(constrainedFits=!0)),f[d][j][b]={fits:l,whole:k,distance:i,outerSize:o,size:n.size},"natural"==b&&l&&k?(h=!0,!1):void 0}),h)return!1}}),a.each(["window","document"],function(b,c){for(var b=0;b=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.options.minIntersection+1-d.size.height)),e._sideChange(d.side),delete d.fits,delete d.outerSize,d.distance=d.distance.horizontal||d.distance.vertical,d.contentOverflow="initial",c.origin=e.instance.$origin[0],c.tooltip=e.instance.$tooltip[0],c.tooltipParent=e.options.parent[0];var h=function(a){d=a};if(e.instance._trigger({type:"position",edit:h,position:d}),e.options.functionPosition){var i=e.options.functionPosition.call(e,e.instance,c,a.extend(!0,{},d));i&&(d=i)}var j,k;"top"==d.side||"bottom"==d.side?(j={prop:"left",val:d.target-d.coord.left},k=d.size.width-this.options.minIntersection):(j={prop:"top",val:d.target-d.coord.top},k=d.size.height-this.options.minIntersection),j.valk&&(j.val=k);var l;l=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:l.left+(d.coord.left-c.geo.origin.windowOffset.left),top:l.top+(d.coord.top-c.geo.origin.windowOffset.top)},e._sideChange(d.side),c.geo.origin.fixedLineage?e.instance.$tooltip.css("position","fixed"):e.instance.$tooltip.css("position",""),e.instance.$tooltip.css({left:d.coord.left,top:d.coord.top}).find(".tooltipster-box").css("overflow",d.contentOverflow).end().find(".tooltipster-arrow").css({left:"",top:""}).css(j.prop,j.val),e.instance.$tooltip.css({height:d.size.height,width:d.size.width}),g.destroy(),e.instance.$tooltip.appendTo(e.instance.options.parent),e.instance._trigger({type:"repositioned",event:b,position:d})},_sideChange:function(a){this.instance.$tooltip.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+a); -},_targetFind:function(a,b){var c,d=this.instance.$origin[0].getClientRects();if(d.length<2)switch(b){case"left":case"right":c=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2);break;case"bottom":case"top":c=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2)}else{var e;switch(b){case"top":e=d[0];break;case"right":e=d.length>2?d[Math.ceil(d.length/2)-1]:d[0];break;case"bottom":e=d[d.length-1];break;case"left":e=d.length>2?d[Math.ceil((d.length+1)/2)-1]:d[d.length-1]}switch(b){case"left":case"right":c=Math.floor(e.top+(e.bottom-e.top)/2);break;case"bottom":case"top":c=Math.floor(e.left+(e.right-e.left)/2)}}return c}}})}(jQuery); \ No newline at end of file +/*! tooltipster v4.0.0rc44 */!function(a){function b(a){this.$container,this.constraints=null,this.$tooltip=a,this._init()}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c="string"==typeof b?b:b.attr("id");return c?!!document.getElementById(c):a.contains(document.body,b[0])}function e(){return!m&&n}function f(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e0?e=k[d]:a.each(k,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");if(k[b.name]=b,b.global){var f=function(){};f.prototype=b.global;var e=new f;c[b.name]=e,e._init&&e._init(c),c._bridge(b.global,e,c,b.name)}return this},setDefaults:function(b){return a.extend(h,b),!0},triggerHandler:function(){return i.triggerHandler.apply(i,Array.prototype.slice.apply(arguments)),this},version:function(){return l}},a.tooltipster=new g,a.Tooltipster=function(b,c){this.callbacks={close:[],open:[]},this.closingTime,this.Content,this.contentBcr,this.destroyed=!1,this.destroying=!1,this.$emitterPrivate=a({}),this.$emitterPublic=a({}),this.enabled=!0,this.garbageCollector,this.geometry,this.IE=p,this.ignoreNextClick=!1,this.mouseIsOverOrigin=!1,this.namespace="tooltipster-"+Math.round(1e5*Math.random()),this.options,this.$origin,this.$originParents,this.previousThemes=[],this.state="closed",this.timeouts={close:[],open:null},this.$tooltip,this.tracker=null,this.tooltipCoord,this._init(b,c)},a.Tooltipster.prototype={_init:function(b,c){var d=this;d.$origin=a(b),d.options=a.extend(!0,{},h,c),d._optionsFormat();var e=null;if(void 0===d.$origin.data("tooltipster-initialTitle")&&(e=d.$origin.attr("title"),void 0===e&&(e=null),d.$origin.data("tooltipster-initialTitle",e)),null!==d.options.content?d._contentSet(d.options.content):d._contentSet(e),d.$origin.removeAttr("title").addClass("tooltipstered"),!d.$origin.hasClass("tooltipstered")){var f=d.$origin.attr("class")||"";-1==f.indexOf("tooltipstered")&&d.$origin.attr("class",f+" tooltipstered")}d._prepareOrigin(),d._prepareGC(),a.each(d.options.plugins,function(b,c){var e=a.tooltipster.plugin(c);if(!e)throw new Error('The "'+c+'" plugin is not defined');if(e.instance){var f=function(){};f.prototype=e.instance;var g=new f;g._init(d),a.tooltipster._bridge(e.instance,g,d,e.name)}}),d._on("created",function(){d._prepareTooltip()})._on("repositioned",function(a){d.tooltipCoord=a.position})},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.destroying){c&&d.callbacks.close.push(c),d.callbacks.open=[],d._timeoutsClear();var g=function(){a.each(d.callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d.$origin[0]})}),d.callbacks.close=[]};if("closed"!=d.state){var h=!0,i=new Date,j=i.getTime(),k=j+d.options.animationDuration[1];if("disappearing"==d.state&&k>d.closingTime&&(h=!1),h){d.closingTime=k,"disappearing"!=d.state&&d._stateSet("disappearing");var l=function(){clearInterval(d.tracker),d._trigger({type:"closing",event:b}),d.$tooltip.off("."+d.namespace+"-triggerClose").removeClass("tooltipster-dying"),a(window).off("."+d.namespace+"-triggerClose"),d.$originParents.each(function(b,c){a(c).off("scroll."+d.namespace+"-triggerClose")}),d.$originParents=null,a("body").off("."+d.namespace+"-triggerClose"),d.$origin.off("."+d.namespace+"-triggerClose"),d._stateSet("closed"),d._trigger({type:"after",event:b}),d.options.functionAfter&&d.options.functionAfter.call(d,d,{event:b,origin:d.$origin[0]}),g()};f()?(d.$tooltip.css({"-moz-animation-duration":d.options.animationDuration[1]+"ms","-ms-animation-duration":d.options.animationDuration[1]+"ms","-o-animation-duration":d.options.animationDuration[1]+"ms","-webkit-animation-duration":d.options.animationDuration[1]+"ms","animation-duration":d.options.animationDuration[1]+"ms","transition-duration":d.options.animationDuration[1]+"ms"}),d.$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.options.animationDuration[1]>0&&d.$tooltip.delay(d.options.animationDuration[1]),d.$tooltip.queue(l)):d.$tooltip.stop().fadeOut(d.options.animationDuration[1],l)}}else g()}return d},_contentInsert:function(){var a=this,b=a.$tooltip.find(".tooltipster-content"),c=a.Content,d=function(a){c=a};a._trigger({type:"format",content:a.Content,format:d}),a.options.functionFormat&&(c=a.options.functionFormat.call(a,a,{origin:a.$origin[0]},a.Content)),"string"!=typeof c||a.options.contentAsHTML?b.empty().append(c):b.text(c)},_contentSet:function(b){b instanceof a&&this.options.contentCloning&&(b=b.clone(!0)),this.Content=b,this._trigger({type:"updated",content:b})},_destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},_geometry:function(){var b=this,c=b.$origin,d=b.$origin.is("area");if(d){var e=b.$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(document),h=a(window),i=c,j={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:window.scrollX||document.documentElement.scrollLeft,top:window.scrollY||document.documentElement.scrollTop},size:{height:h.height(),width:h.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var k=b.$origin.attr("shape"),l=b.$origin.attr("coords");if(l&&(l=l.split(","),a.map(l,function(a,b){l[b]=parseInt(a)})),"default"!=k)switch(k){case"circle":var m=l[0],n=l[1],o=l[2],p=n-o,q=m-o;j.origin.size.height=2*o,j.origin.size.width=j.origin.size.height,j.origin.windowOffset.left+=q,j.origin.windowOffset.top+=p;break;case"rect":var r=l[0],s=l[1],t=l[2],u=l[3];j.origin.size.height=u-s,j.origin.size.width=t-r,j.origin.windowOffset.left+=r,j.origin.windowOffset.top+=s;break;case"poly":for(var v=0,w=0,x=0,y=0,z="even",A=0;Ax&&(x=B,0===A&&(v=x)),v>B&&(v=B),z="odd"):(B>y&&(y=B,1==A&&(w=y)),w>B&&(w=B),z="even")}j.origin.size.height=y-w,j.origin.size.width=x-v,j.origin.windowOffset.left+=v,j.origin.windowOffset.top+=w}}if(window.SVGElement&&c[0]instanceof SVGElement&&SVG.svgjs){SVG.parser||SVG.prepare();var C=SVG.adopt(c[0]);if(C&&C.screenBBox){var D=C.screenBBox();j.origin.size.height=D.height,j.origin.size.width=D.width,j.origin.windowOffset.left=D.x,j.origin.windowOffset.top=D.y}}var E=function(a){j.origin.size.height=a.height,j.origin.windowOffset.left=a.left,j.origin.windowOffset.top=a.top,j.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:E,geometry:{height:j.origin.size.height,left:j.origin.windowOffset.left,top:j.origin.windowOffset.top,width:j.origin.size.width}}),j.origin.windowOffset.right=j.origin.windowOffset.left+j.origin.size.width,j.origin.windowOffset.bottom=j.origin.windowOffset.top+j.origin.size.height,j.origin.offset.left=j.origin.windowOffset.left+window.scrollX,j.origin.offset.top=j.origin.windowOffset.top+window.scrollY,j.origin.offset.bottom=j.origin.offset.top+j.origin.size.height,j.origin.offset.right=j.origin.offset.left+j.origin.size.width,j.available.document={bottom:{height:j.document.size.height-j.origin.offset.bottom,width:j.document.size.width},left:{height:j.document.size.height,width:j.origin.offset.left},right:{height:j.document.size.height,width:j.document.size.width-j.origin.offset.right},top:{height:j.origin.offset.top,width:j.document.size.width}},j.available.window={bottom:{height:Math.max(j.window.size.height-Math.max(j.origin.windowOffset.bottom,0),0),width:j.window.size.width},left:{height:j.window.size.height,width:Math.max(j.origin.windowOffset.left,0)},right:{height:j.window.size.height,width:Math.max(j.window.size.width-Math.max(j.origin.windowOffset.right,0),0)},top:{height:Math.max(j.origin.windowOffset.top,0),width:j.window.size.width}};"html"!=i[0].tagName.toLowerCase();){if("fixed"==i.css("position")){j.origin.fixedLineage=!0;break}i=i.parent()}return j},_off:function(){return this.$emitterPrivate.off.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.$emitterPrivate.on.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(a){var b=this,c=!0;"stable"!=b.state&&"appearing"!=b.state&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c&&(b.options.delay[0]?b.timeouts.open=setTimeout(function(){b.mouseIsOverOrigin&&b._openNow(a)},b.options.delay[0]):b._openNow(a)))},_openNow:function(b,c){var e=this;if(!(e.destroying||b&&e.ignoreNextClick)&&d(e.$origin)){var g=!0;if(e._trigger({type:"before",event:b,stop:function(){g=!1}}),g&&e.options.functionBefore&&(g=e.options.functionBefore.call(e,e,{event:b,origin:e.$origin[0]})),g!==!1&&e.enabled&&null!==e.Content){c&&e.callbacks.open.push(c),e.callbacks.close=[],e._timeoutsClear();var h,i=function(){"stable"!=e.state&&e._stateSet("stable"),a.each(e.callbacks.open,function(a,b){b.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}),e.callbacks.open=[]};if("closed"!==e.state)h=0,"disappearing"===e.state?(e._stateSet("appearing"),f()?(e.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i)):e.$tooltip.stop().fadeIn(i)):"stable"==e.state&&i();else{if(e._stateSet("appearing"),h=e.options.animationDuration[0],e.$tooltip.css({height:0,left:0,top:0,overflow:"hidden",width:0,zIndex:e.options.zIndex}),e._contentInsert(),e.reposition(b,!0),f()?(e.$tooltip.addClass("tooltipster-"+e.options.animation).addClass("tooltipster-initial"),e.$tooltip.css({"-moz-animation-duration":e.options.animationDuration[0]+"ms","-ms-animation-duration":e.options.animationDuration[0]+"ms","-o-animation-duration":e.options.animationDuration[0]+"ms","-webkit-animation-duration":e.options.animationDuration[0]+"ms","animation-duration":e.options.animationDuration[0]+"ms","transition-duration":e.options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.state&&(e.$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i))},0)):e.$tooltip.css("display","none").fadeIn(e.options.animationDuration[0],i),e._trackerStart(),a(window).on("resize."+e.namespace+"-triggerClose",function(a){e.reposition(a)}).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)}),e.$originParents=e.$origin.parents(),e.$originParents.each(function(b,c){a(c).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)})}),e.options.triggerClose.mouseleave){n&&setTimeout(function(){"closed"!=e.state&&a("body").on("touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||e._close()})},0);var j=e.$origin,k=null;e.options.interactive&&(j=j.add(e.$tooltip)),j.on("mouseleave."+e.namespace+"-triggerClose",function(a){e.options.delay[1]?(k=setTimeout(function(){e._close(a)},e.options.delay[1]),e.timeouts.close.push(k)):e._close(a)}).on("mouseenter."+e.namespace+"-triggerClose",function(){clearTimeout(k)})}e.options.triggerClose.originClick&&e.$origin.on("click."+e.namespace+"-triggerClose",function(a){e._close(a)}),e.options.triggerClose.click&&setTimeout(function(){"closed"!=e.state&&a("body").on("click."+e.namespace+"-triggerClose touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||(e._close(b),"touchstart"!=b.type||e.$origin[0]!==b.target&&!a.contains(e.$origin[0],b.target)||(e.ignoreNextClick=!0,setTimeout(function(){e.ignoreNextClick=!1},500)))})},0),e._trigger("ready"),e.options.functionReady&&e.options.functionReady.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}if(e.options.timer>0){var k=setTimeout(function(){e._close()},e.options.timer+h);e.timeouts.close.push(k)}}}},_optionsFormat:function(){"number"==typeof this.options.delay&&(this.options.delay=[this.options.delay,this.options.delay]),"number"==typeof this.options.animationDuration&&(this.options.animationDuration=[this.options.animationDuration,this.options.animationDuration]),"string"==typeof this.options.theme&&(this.options.theme=[this.options.theme]),"string"==typeof this.options.parent&&(this.options.parent=a(this.options.parent)),"hover"==this.options.trigger?(this.options.triggerOpen={hover:!0},this.options.triggerClose={mouseleave:!0,originClick:!0}):"click"==this.options.trigger&&(this.options.triggerOpen={click:!0},this.options.triggerClose={click:!0}),this._trigger("options")},_prepareGC:function(){var a=this;a.options.selfDestruction?a.garbageCollector=setInterval(function(){d(a.$origin)||a.destroy()},2e4):clearInterval(a.garbageCollector)},_prepareOrigin:function(){var a=this;a.$origin.off("."+a.namespace+"-triggerOpen"),a.options.triggerOpen.hover&&(a.$origin.on("mouseenter."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!0,a._open(b))}),n&&a.options.touchDevices&&a.$origin.on("touchstart."+a.namespace+"-triggerOpen",function(b){a._openNow(b)})),a.options.triggerOpen.click&&a.$origin.on("click."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||a._openNow(b)}),a.options.triggerClose.mouseleave&&a.$origin.on("mouseleave."+a.namespace+"-triggerOpen",function(){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!1)})},_prepareTooltip:function(){var b=this;b.$tooltip.attr("id",b.namespace),a.each(b.previousThemes,function(a,c){b.$tooltip.removeClass(c)}),a.each(b.options.theme,function(a,c){b.$tooltip.addClass(c)}),b.previousThemes=a.merge([],b.options.theme);var c=b.options.interactive?"auto":"";b.$tooltip.css("pointer-events",c)},_scrollHandler:function(b){var c=this;if(c.options.triggerClose.scroll)c._close(b);else{if(b.target===document)c.geometry.origin.fixedLineage||c.options.repositionOnScroll&&c.reposition(b);else{var d=c._geometry(),e=!1;if("fixed"!=c.$origin.css("position")&&c.$originParents.each(function(b,c){var f=a(c),g=f.css("overflow-x"),h=f.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(d.origin.windowOffset.lefti.right))return e=!0,!1;if("visible"!=h&&(d.origin.windowOffset.topi.bottom))return e=!0,!1}return"fixed"==f.css("position")?!1:void 0}),e)c.$tooltip.css("visibility","hidden");else if(c.$tooltip.css("visibility","visible"),c.options.repositionOnScroll)c.reposition(b);else{var f=d.origin.offset.left-c.geometry.origin.offset.left,g=d.origin.offset.top-c.geometry.origin.offset.top;c.$tooltip.css({left:c.tooltipCoord.left+f,top:c.tooltipCoord.top+g})}}c._trigger({type:"scroll",event:b})}},_stateSet:function(a){return this.state=a,this._trigger({type:"state",state:a}),this},_timeoutsClear:function(){clearTimeout(this.timeouts.open),this.timeouts.open=null,a.each(this.timeouts.close,function(a,b){clearTimeout(b)}),this.timeouts.close=[]},_trackerStart:function(){var a=this,b=a.$tooltip.find(".tooltipster-content");a.options.trackTooltip&&(a.contentBcr=b[0].getBoundingClientRect()),a.tracker=setInterval(function(){if(d(a.$origin)&&d(a.namespace)){if(a.options.trackOrigin){var e=a._geometry(),f=!1;c(e.origin.size,a.geometry.origin.size)&&(a.geometry.origin.fixedLineage?c(e.origin.windowOffset,a.geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.geometry.origin.offset)&&(f=!0)),f||(a.options.triggerClose.mouseleave?a._close():a.reposition())}if(a.options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.contentBcr.height&&g.width===a.contentBcr.width||(a.reposition(),a.contentBcr=g)}}else a._close()},a.options.trackerInterval)},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),a[0].instance=this,a[0].origin=this.$origin?this.$origin[0]:null,this.$emitterPrivate.trigger.apply(this.$emitterPrivate,a),i.trigger.apply(i,a),this.$emitterPublic.trigger.apply(this.$emitterPublic,a),this},_update:function(a){var b=this;if(b._contentSet(a),null!==b.Content){if("closed"!==b.state&&(b._contentInsert(),b.reposition(),b.options.updateAnimation))if(f()){var c=b.options.updateAnimation;b.$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.state&&b.$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b.$tooltip.fadeTo(200,.5,function(){"closed"!=b.state&&b.$tooltip.fadeTo(200,1)})}else b._close()},close:function(a){return this.destroyed?this._destroyError():this._close(null,a),this},content:function(a){return void 0===a?this.Content:(this.destroyed?this._destroyError():this._update(a),this)},destroy:function(){var b=this;return b.destroyed?b._destroyError():b.destroying||(b.destroying=!0,b._close(null,function(){b.destroying=!1,b.destroyed=!0,b._trigger("destroyed"),b._off(),b.off(),b.$origin.removeData(b.namespace).off("."+b.namespace+"-triggerOpen");var c=b.$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;if("previous"===b.options.restoration?d=b.$origin.data("tooltipster-initialTitle"):"current"===b.options.restoration&&(d="string"==typeof b.Content?b.Content:a("
").append(b.Content).html()),d&&b.$origin.attr("title",d),b.$origin.hasClass("tooltipstered"))b.$origin.removeClass("tooltipstered");else{var e=b.$origin.attr("class").replace("tooltipstered","");b.$origin.attr("class",e)}b.$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.namespace}),b.$origin.data("tooltipster-ns",c);b.Content=null,b.$origin=null,b.$emitterPrivate=null,b.$emitterPublic=null,b.$tooltip=null,b.options.parent=null,j=a.grep(j,function(a,c){return b!==a}),clearInterval(b.garbageCollector)})),b},disable:function(){return this.destroyed?void this._destroyError():(this._close(),this.enabled=!1,this)},elementOrigin:function(){return this.destroyed?void this._destroyError():this.$origin[0]},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:null},enable:function(){return this.enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.destroyed||this.$emitterPublic.off.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.destroyed?this._destroyError():this.$emitterPublic.on.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.destroyed?this._destroyError():this.$emitterPublic.one.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.destroyed||this.destroying?this._destroyError():this._openNow(null,a),this},option:function(b,c){return void 0===c?this.options[b]:(this.destroyed?this._destroyError():(this.options[b]=c,this._optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this._prepareOrigin(),"selfDestruction"===b&&this._prepareGC()),this)},reposition:function(a,b){var c=this;return c.destroyed?c._destroyError():(d(c.namespace)||b)&&(b||c.$tooltip.detach(),c.geometry=c._geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.destroyed,destroying:this.destroying,enabled:this.enabled,open:"closed"!==this.state,state:this.state}},triggerHandler:function(){return this.destroyed?this._destroyError():this.$emitterPublic.triggerHandler.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&"object"==typeof b[1]&&null!==b[1]&&!f.options.contentCloning&&f.options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}j=[];var e=b[0]&&void 0!==b[0].multiple,f=e&&b[0].multiple||!e&&h.multiple,g=b[0]&&void 0!==b[0].content,i=g&&b[0].content||!g&&h.content,k=b[0]&&void 0!==b[0].contentCloning,l=k&&b[0].contentCloning||!k&&h.contentCloning,m=b[0]&&void 0!==b[0].debug,n=m&&b[0].debug||!m&&h.debug;return this.length>1&&"object"==typeof i&&null!==i&&!l&&n&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),g=null;e?f?c=!0:n&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(g=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(g.namespace),d.data("tooltipster-ns",e),d.data(g.namespace,g),g.options.functionInit&&g.options.functionInit.call(g,g,{origin:this}),g._trigger("init")),j.push(g)}),this},b.prototype={_init:function(){this.$container=a('
').append(this.$tooltip).appendTo("body"),this.$tooltip.find(".tooltipster-content").css("overflow","auto")},_forceRedraw:function(){var a=this.$tooltip.parent();this.$tooltip.detach(),this.$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.$tooltip.css({display:"block",height:"",left:0,overflow:"auto",top:0,width:a}),this},destroy:function(){this.$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.$tooltip.css({display:"",height:"",left:0,overflow:"visible",top:0,width:""}),this},measure:function(){this._forceRedraw();var a=this.$tooltip[0].getBoundingClientRect(),b={size:{height:a.bottom,width:a.right}};if(this.constraints){var c=this.$tooltip.find(".tooltipster-content"),d=this.$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return p&&11>=p&&(b.size.width=Math.ceil(b.size.width)+1),b}};var m=!1;a("body").one("mousemove",function(){m=!0});var n=!!("ontouchstart"in window),o=navigator.userAgent.toLowerCase(),p=!1;-1!=o.indexOf("msie")?p=parseInt(o.split("msie")[1]):-1!==o.toLowerCase().indexOf("trident")&&-1!==o.indexOf(" rv:11")?p=11:-1!=o.toLowerCase().indexOf("edge/")&&(p=parseInt(o.toLowerCase().split("edge/")[1]))}(jQuery),function(a){a.tooltipster.plugin({name:"tooltipster.sideTip",instance:{_defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,side:"top"}},_init:function(a){var b=this;b.instance=a,b.options,b.previousState="closed",b._optionsFormat(),b.instance._on("state",function(a){"closed"==a.state?b._close():"appearing"==a.state&&"closed"==b.previousState&&b._create(),b.previousState=a.state}),b.instance._on("options",function(){b._optionsFormat()}),b.instance._on("reposition",function(a){b._reposition(a.event,a.helper)})},_close:function(){"object"==typeof this.instance.Content&&null!==this.instance.Content&&this.instance.Content.detach(),this.instance.$tooltip.remove()},_create:function(){var b=a('
');this.options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.options.minWidth&&b.css("min-width",this.options.minWidth+"px"),this.options.maxWidth&&b.css("max-width",this.options.maxWidth+"px"),this.instance.$tooltip=b,this.instance.$tooltip.appendTo(this.options.parent),this.instance._trigger("created")},_optionsFormat:function(){var b=this._defaults();if(this.options=a.extend(!0,{},b,this.instance.options),this.options.position&&(this.options.side=this.options.position),"object"==typeof this.instance.options.side&&(this.options.side=this.instance.options.side),"object"!=typeof this.options.distance&&(this.options.distance=[this.options.distance]),this.options.distance.length<4&&(void 0===this.options.distance[1]&&(this.options.distance[1]=this.options.distance[0]),void 0===this.options.distance[2]&&(this.options.distance[2]=this.options.distance[0]),void 0===this.options.distance[3]&&(this.options.distance[3]=this.options.distance[1]),this.options.distance={top:this.options.distance[0],right:this.options.distance[1],bottom:this.options.distance[2],left:this.options.distance[3]}),"string"==typeof this.options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};this.options.side=[this.options.side,c[this.options.side]],"left"==this.options.side[0]||"right"==this.options.side[0]?this.options.side.push("top","bottom"):this.options.side.push("right","left")}6===this.instance.IE&&this.options.arrow!==!0&&(this.options.arrow=!1)},_reposition:function(b,c){var d,e=this,f={document:{},window:{}},g=a.tooltipster._getRuler(e.instance.$tooltip);switch(a.each(["window","document"],function(b,d){for(var h=!1,b=0;b=e.options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.options.minIntersection:c.geo.origin.windowOffset.bottom>=e.options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.options.minIntersection,"natural"==b?c.geo.available[d][j].width>=o.width&&c.geo.available[d][j].height>=o.height&&(l=!0,naturalFits=!0):(l=n.fits,l&&(constrainedFits=!0)),f[d][j][b]={fits:l,whole:k,distance:i,outerSize:o,size:n.size},"natural"==b&&l&&k?(h=!0,!1):void 0}),h)return!1}}),a.each(["window","document"],function(b,c){for(var b=0;b=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.options.minIntersection+1-d.size.height)),e._sideChange(d.side),delete d.fits,delete d.outerSize,d.distance=d.distance.horizontal||d.distance.vertical,d.contentOverflow="initial",c.origin=e.instance.$origin[0],c.tooltip=e.instance.$tooltip[0],c.tooltipParent=e.options.parent[0];var h=function(a){d=a};if(e.instance._trigger({type:"position",edit:h,position:d}),e.options.functionPosition){var i=e.options.functionPosition.call(e,e.instance,c,a.extend(!0,{},d));i&&(d=i)}var j,k;"top"==d.side||"bottom"==d.side?(j={prop:"left",val:d.target-d.coord.left},k=d.size.width-this.options.minIntersection):(j={prop:"top",val:d.target-d.coord.top},k=d.size.height-this.options.minIntersection),j.valk&&(j.val=k);var l;l=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:l.left+(d.coord.left-c.geo.origin.windowOffset.left),top:l.top+(d.coord.top-c.geo.origin.windowOffset.top)},e._sideChange(d.side),c.geo.origin.fixedLineage?e.instance.$tooltip.css("position","fixed"):e.instance.$tooltip.css("position",""),e.instance.$tooltip.css({left:d.coord.left,top:d.coord.top}).find(".tooltipster-box").css("overflow",d.contentOverflow).end().find(".tooltipster-arrow").css({left:"",top:""}).css(j.prop,j.val),e.instance.$tooltip.css({height:d.size.height,width:d.size.width}),g.destroy(),e.instance.$tooltip.appendTo(e.instance.options.parent),e.instance._trigger({type:"repositioned",event:b, +position:d})},_sideChange:function(a){this.instance.$tooltip.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+a)},_targetFind:function(a,b){var c,d=this.instance.$origin[0].getClientRects();if(d.length>1){var e=this.instance.$origin.css("opacity");1==e&&(this.instance.$origin.css("opacity",.99),d=this.instance.$origin[0].getClientRects(),this.instance.$origin.css("opacity",1))}if(d.length<2)switch(b){case"left":case"right":c=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2);break;case"bottom":case"top":c=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2)}else{var f;switch(b){case"top":f=d[0];break;case"right":f=d.length>2?d[Math.ceil(d.length/2)-1]:d[0];break;case"bottom":f=d[d.length-1];break;case"left":f=d.length>2?d[Math.ceil((d.length+1)/2)-1]:d[d.length-1]}switch(b){case"left":case"right":c=Math.floor(f.top+(f.bottom-f.top)/2);break;case"bottom":case"top":c=Math.floor(f.left+(f.right-f.left)/2)}}return c}}})}(jQuery); \ No newline at end of file diff --git a/dist/js/tooltipster.core.js b/dist/js/tooltipster.core.js index 8f163ef..5c84c0c 100644 --- a/dist/js/tooltipster.core.js +++ b/dist/js/tooltipster.core.js @@ -54,7 +54,7 @@ // collects plugins in their bare object form plugins = {}, // don't set manually, it will be updated by Grunt after the manifest - semVer = '4.0.0rc43'; + semVer = '4.0.0rc44'; // global methods @@ -284,6 +284,8 @@ this.geometry; // proxy the variable for display plugins who may use it this.IE = IE; + // to fix a touch issue + this.ignoreNextClick = false; this.mouseIsOverOrigin = false; // a unique namespace per instance this.namespace = 'tooltipster-'+ Math.round(Math.random()*100000); @@ -294,7 +296,7 @@ this.$originParents; // to remove themes if needed this.previousThemes = []; - // the state can be either : appearing, stable, disappearing, closed + // the state can be either: appearing, stable, disappearing, closed this.state = 'closed'; // timeout references this.timeouts = { @@ -325,7 +327,7 @@ // some options may need to be reformatted self._optionsFormat(); - // note : the content is null (empty) by default and can stay that + // note: the content is null (empty) by default and can stay that // way if the plugin remains initialized but not fed any content. The // tooltip will just not appear. @@ -347,7 +349,7 @@ // If content is provided in the options, it has precedence over the // title attribute. - // Note : an empty string is considered content, only 'null' represents + // Note: an empty string is considered content, only 'null' represents // the absence of content. // Also, an existing title="" attribute will result in an empty string // content @@ -634,7 +636,7 @@ // clone if asked. Cloning the object makes sure that each instance has its // own version of the content (in case a same object were provided for several // instances) - // reminder : typeof null === object + // reminder: typeof null === object if (content instanceof $ && this.options.contentCloning) { content = content.clone(true); } @@ -1018,8 +1020,11 @@ var self = this; - // if the destruction process has not begun - if (!self.destroying) { + // if the destruction process has not begun and if this was not + // triggered by an unwanted emulated click event + if ( !self.destroying + && (!event || !self.ignoreNextClick) + ) { // check that the origin is still in the DOM if (bodyContains(self.$origin)) { @@ -1233,7 +1238,7 @@ // if the user touches the body, close if (deviceHasTouchCapability) { - // timeout 0 : to prevent immediate closing if the method was called + // timeout 0: to prevent immediate closing if the method was called // on a click event and if options.delay == 0 (because of bubbling) setTimeout(function() { @@ -1298,14 +1303,37 @@ // to close the tooltip if (self.options.triggerClose.click) { - // explanations : same as above + // explanations: same as above setTimeout(function() { if (self.state != 'closed') { $('body').on('click.'+ self.namespace +'-triggerClose touchstart.'+ self.namespace +'-triggerClose', function(event) { if (!self.options.interactive || !$.contains(self.$tooltip[0], event.target)) { + self._close(event); + + // the touchstart event is about to be emulated into a click event. But now the + // tooltip is closed, if this emulated click happens on the origin, it will open + // the tooltip again right away (at least in Safari, not sure why the other + // browsers decide not to reopen it). We could call event.preventDefault() to + // prevent the emulation but it could also prevent browser normal behaviors like + // scrolling or zooming, so we'll let the click be triggered and just ignore it + // in ::_openNow() + if ( event.type == 'touchstart' + && ( self.$origin[0] === event.target + || $.contains(self.$origin[0], event.target) + ) + ) { + + self.ignoreNextClick = true; + + // the emulated click is triggered a crazy long time after the touch event, + // at least on an iPhone4 + setTimeout(function() { + self.ignoreNextClick = false; + }, 500); + } } }); } @@ -1410,9 +1438,9 @@ // in case we're resetting the triggers self.$origin.off('.'+ self.namespace +'-triggerOpen'); - // for 'click' and 'hover' open triggers : bind on events to open the tooltip. + // for 'click' and 'hover' open triggers: bind on events to open the tooltip. // Closing is now handled in _openNow() because of its bindings. - // Notes about touch events : + // Notes about touch events: // - mouseenter, mouseleave and clicks happen even on pure touch devices // because they are emulated. deviceIsPureTouch() is a simple attempt // to detect them. @@ -1443,8 +1471,8 @@ if (self.options.triggerOpen.click) { - // note : for touch devices, we do not bind on touchstart, we only rely - // on the emulated clicks (triggered by taps) + // note: for touch devices, we do not bind on touchstart, we only rely + // on the emulated clicks (emulated after touchstart) self.$origin.on('click.'+ self.namespace +'-triggerOpen', function(event) { if (!deviceIsPureTouch() || self.options.touchDevices) { self._openNow(event); @@ -2172,7 +2200,7 @@ // for using in closures var args = Array.prototype.slice.apply(arguments), - // common mistake : an HTML element can't be in several tooltips at the same time + // common mistake: an HTML element can't be in several tooltips at the same time contentCloningWarning = 'You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.'; // this happens with $(sel).tooltipster(...) when $(sel) does not match anything @@ -2347,7 +2375,7 @@ /** * Move the tooltip into an invisible div that does not allow overflow to make - * size tests. Note : the tooltip may or may not be attached to the DOM at the + * size tests. Note: the tooltip may or may not be attached to the DOM at the * moment this method is called, it does not matter. */ _init: function() { @@ -2370,7 +2398,7 @@ */ _forceRedraw: function() { - // note : this would work but for Webkit only + // note: this would work but for Webkit only //this.$tooltip.close(); //this.$tooltip[0].offsetHeight; //this.$tooltip.open(); diff --git a/dist/js/tooltipster.core.min.js b/dist/js/tooltipster.core.min.js index db48785..00d4e43 100644 --- a/dist/js/tooltipster.core.min.js +++ b/dist/js/tooltipster.core.min.js @@ -1 +1 @@ -/*! tooltipster v4.0.0rc43 */!function(a){function b(a){this.$container,this.constraints=null,this.$tooltip=a,this._init()}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c="string"==typeof b?b:b.attr("id");return c?!!document.getElementById(c):a.contains(document.body,b[0])}function e(){return!m&&n}function f(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e0?e=k[d]:a.each(k,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");if(k[b.name]=b,b.global){var f=function(){};f.prototype=b.global;var e=new f;c[b.name]=e,e._init&&e._init(c),c._bridge(b.global,e,c,b.name)}return this},setDefaults:function(b){return a.extend(h,b),!0},triggerHandler:function(){return i.triggerHandler.apply(i,Array.prototype.slice.apply(arguments)),this},version:function(){return l}},a.tooltipster=new g,a.Tooltipster=function(b,c){this.callbacks={close:[],open:[]},this.closingTime,this.Content,this.contentBcr,this.destroyed=!1,this.destroying=!1,this.$emitterPrivate=a({}),this.$emitterPublic=a({}),this.enabled=!0,this.garbageCollector,this.geometry,this.IE=p,this.mouseIsOverOrigin=!1,this.namespace="tooltipster-"+Math.round(1e5*Math.random()),this.options,this.$origin,this.$originParents,this.previousThemes=[],this.state="closed",this.timeouts={close:[],open:null},this.$tooltip,this.tracker=null,this.tooltipCoord,this._init(b,c)},a.Tooltipster.prototype={_init:function(b,c){var d=this;d.$origin=a(b),d.options=a.extend(!0,{},h,c),d._optionsFormat();var e=null;if(void 0===d.$origin.data("tooltipster-initialTitle")&&(e=d.$origin.attr("title"),void 0===e&&(e=null),d.$origin.data("tooltipster-initialTitle",e)),null!==d.options.content?d._contentSet(d.options.content):d._contentSet(e),d.$origin.removeAttr("title").addClass("tooltipstered"),!d.$origin.hasClass("tooltipstered")){var f=d.$origin.attr("class")||"";-1==f.indexOf("tooltipstered")&&d.$origin.attr("class",f+" tooltipstered")}d._prepareOrigin(),d._prepareGC(),a.each(d.options.plugins,function(b,c){var e=a.tooltipster.plugin(c);if(!e)throw new Error('The "'+c+'" plugin is not defined');if(e.instance){var f=function(){};f.prototype=e.instance;var g=new f;g._init(d),a.tooltipster._bridge(e.instance,g,d,e.name)}}),d._on("created",function(){d._prepareTooltip()})._on("repositioned",function(a){d.tooltipCoord=a.position})},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.destroying){c&&d.callbacks.close.push(c),d.callbacks.open=[],d._timeoutsClear();var g=function(){a.each(d.callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d.$origin[0]})}),d.callbacks.close=[]};if("closed"!=d.state){var h=!0,i=new Date,j=i.getTime(),k=j+d.options.animationDuration[1];if("disappearing"==d.state&&k>d.closingTime&&(h=!1),h){d.closingTime=k,"disappearing"!=d.state&&d._stateSet("disappearing");var l=function(){clearInterval(d.tracker),d._trigger({type:"closing",event:b}),d.$tooltip.off("."+d.namespace+"-triggerClose").removeClass("tooltipster-dying"),a(window).off("."+d.namespace+"-triggerClose"),d.$originParents.each(function(b,c){a(c).off("scroll."+d.namespace+"-triggerClose")}),d.$originParents=null,a("body").off("."+d.namespace+"-triggerClose"),d.$origin.off("."+d.namespace+"-triggerClose"),d._stateSet("closed"),d._trigger({type:"after",event:b}),d.options.functionAfter&&d.options.functionAfter.call(d,d,{event:b,origin:d.$origin[0]}),g()};f()?(d.$tooltip.css({"-moz-animation-duration":d.options.animationDuration[1]+"ms","-ms-animation-duration":d.options.animationDuration[1]+"ms","-o-animation-duration":d.options.animationDuration[1]+"ms","-webkit-animation-duration":d.options.animationDuration[1]+"ms","animation-duration":d.options.animationDuration[1]+"ms","transition-duration":d.options.animationDuration[1]+"ms"}),d.$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.options.animationDuration[1]>0&&d.$tooltip.delay(d.options.animationDuration[1]),d.$tooltip.queue(l)):d.$tooltip.stop().fadeOut(d.options.animationDuration[1],l)}}else g()}return d},_contentInsert:function(){var a=this,b=a.$tooltip.find(".tooltipster-content"),c=a.Content,d=function(a){c=a};a._trigger({type:"format",content:a.Content,format:d}),a.options.functionFormat&&(c=a.options.functionFormat.call(a,a,{origin:a.$origin[0]},a.Content)),"string"!=typeof c||a.options.contentAsHTML?b.empty().append(c):b.text(c)},_contentSet:function(b){b instanceof a&&this.options.contentCloning&&(b=b.clone(!0)),this.Content=b,this._trigger({type:"updated",content:b})},_destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},_geometry:function(){var b=this,c=b.$origin,d=b.$origin.is("area");if(d){var e=b.$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(document),h=a(window),i=c,j={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:window.scrollX||document.documentElement.scrollLeft,top:window.scrollY||document.documentElement.scrollTop},size:{height:h.height(),width:h.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var k=b.$origin.attr("shape"),l=b.$origin.attr("coords");if(l&&(l=l.split(","),a.map(l,function(a,b){l[b]=parseInt(a)})),"default"!=k)switch(k){case"circle":var m=l[0],n=l[1],o=l[2],p=n-o,q=m-o;j.origin.size.height=2*o,j.origin.size.width=j.origin.size.height,j.origin.windowOffset.left+=q,j.origin.windowOffset.top+=p;break;case"rect":var r=l[0],s=l[1],t=l[2],u=l[3];j.origin.size.height=u-s,j.origin.size.width=t-r,j.origin.windowOffset.left+=r,j.origin.windowOffset.top+=s;break;case"poly":for(var v=0,w=0,x=0,y=0,z="even",A=0;Ax&&(x=B,0===A&&(v=x)),v>B&&(v=B),z="odd"):(B>y&&(y=B,1==A&&(w=y)),w>B&&(w=B),z="even")}j.origin.size.height=y-w,j.origin.size.width=x-v,j.origin.windowOffset.left+=v,j.origin.windowOffset.top+=w}}if(window.SVGElement&&c[0]instanceof SVGElement&&SVG.svgjs){SVG.parser||SVG.prepare();var C=SVG.adopt(c[0]);if(C&&C.screenBBox){var D=C.screenBBox();j.origin.size.height=D.height,j.origin.size.width=D.width,j.origin.windowOffset.left=D.x,j.origin.windowOffset.top=D.y}}var E=function(a){j.origin.size.height=a.height,j.origin.windowOffset.left=a.left,j.origin.windowOffset.top=a.top,j.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:E,geometry:{height:j.origin.size.height,left:j.origin.windowOffset.left,top:j.origin.windowOffset.top,width:j.origin.size.width}}),j.origin.windowOffset.right=j.origin.windowOffset.left+j.origin.size.width,j.origin.windowOffset.bottom=j.origin.windowOffset.top+j.origin.size.height,j.origin.offset.left=j.origin.windowOffset.left+window.scrollX,j.origin.offset.top=j.origin.windowOffset.top+window.scrollY,j.origin.offset.bottom=j.origin.offset.top+j.origin.size.height,j.origin.offset.right=j.origin.offset.left+j.origin.size.width,j.available.document={bottom:{height:j.document.size.height-j.origin.offset.bottom,width:j.document.size.width},left:{height:j.document.size.height,width:j.origin.offset.left},right:{height:j.document.size.height,width:j.document.size.width-j.origin.offset.right},top:{height:j.origin.offset.top,width:j.document.size.width}},j.available.window={bottom:{height:Math.max(j.window.size.height-Math.max(j.origin.windowOffset.bottom,0),0),width:j.window.size.width},left:{height:j.window.size.height,width:Math.max(j.origin.windowOffset.left,0)},right:{height:j.window.size.height,width:Math.max(j.window.size.width-Math.max(j.origin.windowOffset.right,0),0)},top:{height:Math.max(j.origin.windowOffset.top,0),width:j.window.size.width}};"html"!=i[0].tagName.toLowerCase();){if("fixed"==i.css("position")){j.origin.fixedLineage=!0;break}i=i.parent()}return j},_off:function(){return this.$emitterPrivate.off.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.$emitterPrivate.on.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(a){var b=this,c=!0;"stable"!=b.state&&"appearing"!=b.state&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c&&(b.options.delay[0]?b.timeouts.open=setTimeout(function(){b.mouseIsOverOrigin&&b._openNow(a)},b.options.delay[0]):b._openNow(a)))},_openNow:function(b,c){var e=this;if(!e.destroying&&d(e.$origin)){var g=!0;if(e._trigger({type:"before",event:b,stop:function(){g=!1}}),g&&e.options.functionBefore&&(g=e.options.functionBefore.call(e,e,{event:b,origin:e.$origin[0]})),g!==!1&&e.enabled&&null!==e.Content){c&&e.callbacks.open.push(c),e.callbacks.close=[],e._timeoutsClear();var h,i=function(){"stable"!=e.state&&e._stateSet("stable"),a.each(e.callbacks.open,function(a,b){b.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}),e.callbacks.open=[]};if("closed"!==e.state)h=0,"disappearing"===e.state?(e._stateSet("appearing"),f()?(e.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i)):e.$tooltip.stop().fadeIn(i)):"stable"==e.state&&i();else{if(e._stateSet("appearing"),h=e.options.animationDuration[0],e.$tooltip.css({height:0,left:0,top:0,overflow:"hidden",width:0,zIndex:e.options.zIndex}),e._contentInsert(),e.reposition(b,!0),f()?(e.$tooltip.addClass("tooltipster-"+e.options.animation).addClass("tooltipster-initial"),e.$tooltip.css({"-moz-animation-duration":e.options.animationDuration[0]+"ms","-ms-animation-duration":e.options.animationDuration[0]+"ms","-o-animation-duration":e.options.animationDuration[0]+"ms","-webkit-animation-duration":e.options.animationDuration[0]+"ms","animation-duration":e.options.animationDuration[0]+"ms","transition-duration":e.options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.state&&(e.$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i))},0)):e.$tooltip.css("display","none").fadeIn(e.options.animationDuration[0],i),e._trackerStart(),a(window).on("resize."+e.namespace+"-triggerClose",function(a){e.reposition(a)}).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)}),e.$originParents=e.$origin.parents(),e.$originParents.each(function(b,c){a(c).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)})}),e.options.triggerClose.mouseleave){n&&setTimeout(function(){"closed"!=e.state&&a("body").on("touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||e._close()})},0);var j=e.$origin,k=null;e.options.interactive&&(j=j.add(e.$tooltip)),j.on("mouseleave."+e.namespace+"-triggerClose",function(a){e.options.delay[1]?(k=setTimeout(function(){e._close(a)},e.options.delay[1]),e.timeouts.close.push(k)):e._close(a)}).on("mouseenter."+e.namespace+"-triggerClose",function(){clearTimeout(k)})}e.options.triggerClose.originClick&&e.$origin.on("click."+e.namespace+"-triggerClose",function(a){e._close(a)}),e.options.triggerClose.click&&setTimeout(function(){"closed"!=e.state&&a("body").on("click."+e.namespace+"-triggerClose touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||e._close(b)})},0),e._trigger("ready"),e.options.functionReady&&e.options.functionReady.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}if(e.options.timer>0){var k=setTimeout(function(){e._close()},e.options.timer+h);e.timeouts.close.push(k)}}}},_optionsFormat:function(){"number"==typeof this.options.delay&&(this.options.delay=[this.options.delay,this.options.delay]),"number"==typeof this.options.animationDuration&&(this.options.animationDuration=[this.options.animationDuration,this.options.animationDuration]),"string"==typeof this.options.theme&&(this.options.theme=[this.options.theme]),"string"==typeof this.options.parent&&(this.options.parent=a(this.options.parent)),"hover"==this.options.trigger?(this.options.triggerOpen={hover:!0},this.options.triggerClose={mouseleave:!0,originClick:!0}):"click"==this.options.trigger&&(this.options.triggerOpen={click:!0},this.options.triggerClose={click:!0}),this._trigger("options")},_prepareGC:function(){var a=this;a.options.selfDestruction?a.garbageCollector=setInterval(function(){d(a.$origin)||a.destroy()},2e4):clearInterval(a.garbageCollector)},_prepareOrigin:function(){var a=this;a.$origin.off("."+a.namespace+"-triggerOpen"),a.options.triggerOpen.hover&&(a.$origin.on("mouseenter."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!0,a._open(b))}),n&&a.options.touchDevices&&a.$origin.on("touchstart."+a.namespace+"-triggerOpen",function(b){a._openNow(b)})),a.options.triggerOpen.click&&a.$origin.on("click."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||a._openNow(b)}),a.options.triggerClose.mouseleave&&a.$origin.on("mouseleave."+a.namespace+"-triggerOpen",function(){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!1)})},_prepareTooltip:function(){var b=this;b.$tooltip.attr("id",b.namespace),a.each(b.previousThemes,function(a,c){b.$tooltip.removeClass(c)}),a.each(b.options.theme,function(a,c){b.$tooltip.addClass(c)}),b.previousThemes=a.merge([],b.options.theme);var c=b.options.interactive?"auto":"";b.$tooltip.css("pointer-events",c)},_scrollHandler:function(b){var c=this;if(c.options.triggerClose.scroll)c._close(b);else{if(b.target===document)c.geometry.origin.fixedLineage||c.options.repositionOnScroll&&c.reposition(b);else{var d=c._geometry(),e=!1;if("fixed"!=c.$origin.css("position")&&c.$originParents.each(function(b,c){var f=a(c),g=f.css("overflow-x"),h=f.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(d.origin.windowOffset.lefti.right))return e=!0,!1;if("visible"!=h&&(d.origin.windowOffset.topi.bottom))return e=!0,!1}return"fixed"==f.css("position")?!1:void 0}),e)c.$tooltip.css("visibility","hidden");else if(c.$tooltip.css("visibility","visible"),c.options.repositionOnScroll)c.reposition(b);else{var f=d.origin.offset.left-c.geometry.origin.offset.left,g=d.origin.offset.top-c.geometry.origin.offset.top;c.$tooltip.css({left:c.tooltipCoord.left+f,top:c.tooltipCoord.top+g})}}c._trigger({type:"scroll",event:b})}},_stateSet:function(a){return this.state=a,this._trigger({type:"state",state:a}),this},_timeoutsClear:function(){clearTimeout(this.timeouts.open),this.timeouts.open=null,a.each(this.timeouts.close,function(a,b){clearTimeout(b)}),this.timeouts.close=[]},_trackerStart:function(){var a=this,b=a.$tooltip.find(".tooltipster-content");a.options.trackTooltip&&(a.contentBcr=b[0].getBoundingClientRect()),a.tracker=setInterval(function(){if(d(a.$origin)&&d(a.namespace)){if(a.options.trackOrigin){var e=a._geometry(),f=!1;c(e.origin.size,a.geometry.origin.size)&&(a.geometry.origin.fixedLineage?c(e.origin.windowOffset,a.geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.geometry.origin.offset)&&(f=!0)),f||(a.options.triggerClose.mouseleave?a._close():a.reposition())}if(a.options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.contentBcr.height&&g.width===a.contentBcr.width||(a.reposition(),a.contentBcr=g)}}else a._close()},a.options.trackerInterval)},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),a[0].instance=this,a[0].origin=this.$origin?this.$origin[0]:null,this.$emitterPrivate.trigger.apply(this.$emitterPrivate,a),i.trigger.apply(i,a),this.$emitterPublic.trigger.apply(this.$emitterPublic,a),this},_update:function(a){var b=this;if(b._contentSet(a),null!==b.Content){if("closed"!==b.state&&(b._contentInsert(),b.reposition(),b.options.updateAnimation))if(f()){var c=b.options.updateAnimation;b.$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.state&&b.$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b.$tooltip.fadeTo(200,.5,function(){"closed"!=b.state&&b.$tooltip.fadeTo(200,1)})}else b._close()},close:function(a){return this.destroyed?this._destroyError():this._close(null,a),this},content:function(a){return void 0===a?this.Content:(this.destroyed?this._destroyError():this._update(a),this)},destroy:function(){var b=this;return b.destroyed?b._destroyError():b.destroying||(b.destroying=!0,b._close(null,function(){b.destroying=!1,b.destroyed=!0,b._trigger("destroyed"),b._off(),b.off(),b.$origin.removeData(b.namespace).off("."+b.namespace+"-triggerOpen");var c=b.$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;if("previous"===b.options.restoration?d=b.$origin.data("tooltipster-initialTitle"):"current"===b.options.restoration&&(d="string"==typeof b.Content?b.Content:a("
").append(b.Content).html()),d&&b.$origin.attr("title",d),b.$origin.hasClass("tooltipstered"))b.$origin.removeClass("tooltipstered");else{var e=b.$origin.attr("class").replace("tooltipstered","");b.$origin.attr("class",e)}b.$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.namespace}),b.$origin.data("tooltipster-ns",c);b.Content=null,b.$origin=null,b.$emitterPrivate=null,b.$emitterPublic=null,b.$tooltip=null,b.options.parent=null,j=a.grep(j,function(a,c){return b!==a}),clearInterval(b.garbageCollector)})),b},disable:function(){return this.destroyed?void this._destroyError():(this._close(),this.enabled=!1,this)},elementOrigin:function(){return this.destroyed?void this._destroyError():this.$origin[0]},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:null},enable:function(){return this.enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.destroyed||this.$emitterPublic.off.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.destroyed?this._destroyError():this.$emitterPublic.on.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.destroyed?this._destroyError():this.$emitterPublic.one.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.destroyed||this.destroying?this._destroyError():this._openNow(null,a),this},option:function(b,c){return void 0===c?this.options[b]:(this.destroyed?this._destroyError():(this.options[b]=c,this._optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this._prepareOrigin(),"selfDestruction"===b&&this._prepareGC()),this)},reposition:function(a,b){var c=this;return c.destroyed?c._destroyError():(d(c.namespace)||b)&&(b||c.$tooltip.detach(),c.geometry=c._geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.destroyed,destroying:this.destroying,enabled:this.enabled,open:"closed"!==this.state,state:this.state}},triggerHandler:function(){return this.destroyed?this._destroyError():this.$emitterPublic.triggerHandler.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&"object"==typeof b[1]&&null!==b[1]&&!f.options.contentCloning&&f.options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}j=[];var e=b[0]&&void 0!==b[0].multiple,f=e&&b[0].multiple||!e&&h.multiple,g=b[0]&&void 0!==b[0].content,i=g&&b[0].content||!g&&h.content,k=b[0]&&void 0!==b[0].contentCloning,l=k&&b[0].contentCloning||!k&&h.contentCloning,m=b[0]&&void 0!==b[0].debug,n=m&&b[0].debug||!m&&h.debug;return this.length>1&&"object"==typeof i&&null!==i&&!l&&n&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),g=null;e?f?c=!0:n&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(g=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(g.namespace),d.data("tooltipster-ns",e),d.data(g.namespace,g),g.options.functionInit&&g.options.functionInit.call(g,g,{origin:this}),g._trigger("init")),j.push(g)}),this},b.prototype={_init:function(){this.$container=a('
').append(this.$tooltip).appendTo("body"),this.$tooltip.find(".tooltipster-content").css("overflow","auto")},_forceRedraw:function(){var a=this.$tooltip.parent();this.$tooltip.detach(),this.$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.$tooltip.css({display:"block",height:"",left:0,overflow:"auto",top:0,width:a}),this},destroy:function(){this.$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.$tooltip.css({display:"",height:"",left:0,overflow:"visible",top:0,width:""}),this},measure:function(){this._forceRedraw();var a=this.$tooltip[0].getBoundingClientRect(),b={size:{height:a.bottom,width:a.right}};if(this.constraints){var c=this.$tooltip.find(".tooltipster-content"),d=this.$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return p&&11>=p&&(b.size.width=Math.ceil(b.size.width)+1),b}};var m=!1;a("body").one("mousemove",function(){m=!0});var n=!!("ontouchstart"in window),o=navigator.userAgent.toLowerCase(),p=!1;-1!=o.indexOf("msie")?p=parseInt(o.split("msie")[1]):-1!==o.toLowerCase().indexOf("trident")&&-1!==o.indexOf(" rv:11")?p=11:-1!=o.toLowerCase().indexOf("edge/")&&(p=parseInt(o.toLowerCase().split("edge/")[1]))}(jQuery); \ No newline at end of file +/*! tooltipster v4.0.0rc44 */!function(a){function b(a){this.$container,this.constraints=null,this.$tooltip=a,this._init()}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c="string"==typeof b?b:b.attr("id");return c?!!document.getElementById(c):a.contains(document.body,b[0])}function e(){return!m&&n}function f(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e0?e=k[d]:a.each(k,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");if(k[b.name]=b,b.global){var f=function(){};f.prototype=b.global;var e=new f;c[b.name]=e,e._init&&e._init(c),c._bridge(b.global,e,c,b.name)}return this},setDefaults:function(b){return a.extend(h,b),!0},triggerHandler:function(){return i.triggerHandler.apply(i,Array.prototype.slice.apply(arguments)),this},version:function(){return l}},a.tooltipster=new g,a.Tooltipster=function(b,c){this.callbacks={close:[],open:[]},this.closingTime,this.Content,this.contentBcr,this.destroyed=!1,this.destroying=!1,this.$emitterPrivate=a({}),this.$emitterPublic=a({}),this.enabled=!0,this.garbageCollector,this.geometry,this.IE=p,this.ignoreNextClick=!1,this.mouseIsOverOrigin=!1,this.namespace="tooltipster-"+Math.round(1e5*Math.random()),this.options,this.$origin,this.$originParents,this.previousThemes=[],this.state="closed",this.timeouts={close:[],open:null},this.$tooltip,this.tracker=null,this.tooltipCoord,this._init(b,c)},a.Tooltipster.prototype={_init:function(b,c){var d=this;d.$origin=a(b),d.options=a.extend(!0,{},h,c),d._optionsFormat();var e=null;if(void 0===d.$origin.data("tooltipster-initialTitle")&&(e=d.$origin.attr("title"),void 0===e&&(e=null),d.$origin.data("tooltipster-initialTitle",e)),null!==d.options.content?d._contentSet(d.options.content):d._contentSet(e),d.$origin.removeAttr("title").addClass("tooltipstered"),!d.$origin.hasClass("tooltipstered")){var f=d.$origin.attr("class")||"";-1==f.indexOf("tooltipstered")&&d.$origin.attr("class",f+" tooltipstered")}d._prepareOrigin(),d._prepareGC(),a.each(d.options.plugins,function(b,c){var e=a.tooltipster.plugin(c);if(!e)throw new Error('The "'+c+'" plugin is not defined');if(e.instance){var f=function(){};f.prototype=e.instance;var g=new f;g._init(d),a.tooltipster._bridge(e.instance,g,d,e.name)}}),d._on("created",function(){d._prepareTooltip()})._on("repositioned",function(a){d.tooltipCoord=a.position})},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.destroying){c&&d.callbacks.close.push(c),d.callbacks.open=[],d._timeoutsClear();var g=function(){a.each(d.callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d.$origin[0]})}),d.callbacks.close=[]};if("closed"!=d.state){var h=!0,i=new Date,j=i.getTime(),k=j+d.options.animationDuration[1];if("disappearing"==d.state&&k>d.closingTime&&(h=!1),h){d.closingTime=k,"disappearing"!=d.state&&d._stateSet("disappearing");var l=function(){clearInterval(d.tracker),d._trigger({type:"closing",event:b}),d.$tooltip.off("."+d.namespace+"-triggerClose").removeClass("tooltipster-dying"),a(window).off("."+d.namespace+"-triggerClose"),d.$originParents.each(function(b,c){a(c).off("scroll."+d.namespace+"-triggerClose")}),d.$originParents=null,a("body").off("."+d.namespace+"-triggerClose"),d.$origin.off("."+d.namespace+"-triggerClose"),d._stateSet("closed"),d._trigger({type:"after",event:b}),d.options.functionAfter&&d.options.functionAfter.call(d,d,{event:b,origin:d.$origin[0]}),g()};f()?(d.$tooltip.css({"-moz-animation-duration":d.options.animationDuration[1]+"ms","-ms-animation-duration":d.options.animationDuration[1]+"ms","-o-animation-duration":d.options.animationDuration[1]+"ms","-webkit-animation-duration":d.options.animationDuration[1]+"ms","animation-duration":d.options.animationDuration[1]+"ms","transition-duration":d.options.animationDuration[1]+"ms"}),d.$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.options.animationDuration[1]>0&&d.$tooltip.delay(d.options.animationDuration[1]),d.$tooltip.queue(l)):d.$tooltip.stop().fadeOut(d.options.animationDuration[1],l)}}else g()}return d},_contentInsert:function(){var a=this,b=a.$tooltip.find(".tooltipster-content"),c=a.Content,d=function(a){c=a};a._trigger({type:"format",content:a.Content,format:d}),a.options.functionFormat&&(c=a.options.functionFormat.call(a,a,{origin:a.$origin[0]},a.Content)),"string"!=typeof c||a.options.contentAsHTML?b.empty().append(c):b.text(c)},_contentSet:function(b){b instanceof a&&this.options.contentCloning&&(b=b.clone(!0)),this.Content=b,this._trigger({type:"updated",content:b})},_destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},_geometry:function(){var b=this,c=b.$origin,d=b.$origin.is("area");if(d){var e=b.$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(document),h=a(window),i=c,j={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:window.scrollX||document.documentElement.scrollLeft,top:window.scrollY||document.documentElement.scrollTop},size:{height:h.height(),width:h.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var k=b.$origin.attr("shape"),l=b.$origin.attr("coords");if(l&&(l=l.split(","),a.map(l,function(a,b){l[b]=parseInt(a)})),"default"!=k)switch(k){case"circle":var m=l[0],n=l[1],o=l[2],p=n-o,q=m-o;j.origin.size.height=2*o,j.origin.size.width=j.origin.size.height,j.origin.windowOffset.left+=q,j.origin.windowOffset.top+=p;break;case"rect":var r=l[0],s=l[1],t=l[2],u=l[3];j.origin.size.height=u-s,j.origin.size.width=t-r,j.origin.windowOffset.left+=r,j.origin.windowOffset.top+=s;break;case"poly":for(var v=0,w=0,x=0,y=0,z="even",A=0;Ax&&(x=B,0===A&&(v=x)),v>B&&(v=B),z="odd"):(B>y&&(y=B,1==A&&(w=y)),w>B&&(w=B),z="even")}j.origin.size.height=y-w,j.origin.size.width=x-v,j.origin.windowOffset.left+=v,j.origin.windowOffset.top+=w}}if(window.SVGElement&&c[0]instanceof SVGElement&&SVG.svgjs){SVG.parser||SVG.prepare();var C=SVG.adopt(c[0]);if(C&&C.screenBBox){var D=C.screenBBox();j.origin.size.height=D.height,j.origin.size.width=D.width,j.origin.windowOffset.left=D.x,j.origin.windowOffset.top=D.y}}var E=function(a){j.origin.size.height=a.height,j.origin.windowOffset.left=a.left,j.origin.windowOffset.top=a.top,j.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:E,geometry:{height:j.origin.size.height,left:j.origin.windowOffset.left,top:j.origin.windowOffset.top,width:j.origin.size.width}}),j.origin.windowOffset.right=j.origin.windowOffset.left+j.origin.size.width,j.origin.windowOffset.bottom=j.origin.windowOffset.top+j.origin.size.height,j.origin.offset.left=j.origin.windowOffset.left+window.scrollX,j.origin.offset.top=j.origin.windowOffset.top+window.scrollY,j.origin.offset.bottom=j.origin.offset.top+j.origin.size.height,j.origin.offset.right=j.origin.offset.left+j.origin.size.width,j.available.document={bottom:{height:j.document.size.height-j.origin.offset.bottom,width:j.document.size.width},left:{height:j.document.size.height,width:j.origin.offset.left},right:{height:j.document.size.height,width:j.document.size.width-j.origin.offset.right},top:{height:j.origin.offset.top,width:j.document.size.width}},j.available.window={bottom:{height:Math.max(j.window.size.height-Math.max(j.origin.windowOffset.bottom,0),0),width:j.window.size.width},left:{height:j.window.size.height,width:Math.max(j.origin.windowOffset.left,0)},right:{height:j.window.size.height,width:Math.max(j.window.size.width-Math.max(j.origin.windowOffset.right,0),0)},top:{height:Math.max(j.origin.windowOffset.top,0),width:j.window.size.width}};"html"!=i[0].tagName.toLowerCase();){if("fixed"==i.css("position")){j.origin.fixedLineage=!0;break}i=i.parent()}return j},_off:function(){return this.$emitterPrivate.off.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.$emitterPrivate.on.apply(this.$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(a){var b=this,c=!0;"stable"!=b.state&&"appearing"!=b.state&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c&&(b.options.delay[0]?b.timeouts.open=setTimeout(function(){b.mouseIsOverOrigin&&b._openNow(a)},b.options.delay[0]):b._openNow(a)))},_openNow:function(b,c){var e=this;if(!(e.destroying||b&&e.ignoreNextClick)&&d(e.$origin)){var g=!0;if(e._trigger({type:"before",event:b,stop:function(){g=!1}}),g&&e.options.functionBefore&&(g=e.options.functionBefore.call(e,e,{event:b,origin:e.$origin[0]})),g!==!1&&e.enabled&&null!==e.Content){c&&e.callbacks.open.push(c),e.callbacks.close=[],e._timeoutsClear();var h,i=function(){"stable"!=e.state&&e._stateSet("stable"),a.each(e.callbacks.open,function(a,b){b.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}),e.callbacks.open=[]};if("closed"!==e.state)h=0,"disappearing"===e.state?(e._stateSet("appearing"),f()?(e.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i)):e.$tooltip.stop().fadeIn(i)):"stable"==e.state&&i();else{if(e._stateSet("appearing"),h=e.options.animationDuration[0],e.$tooltip.css({height:0,left:0,top:0,overflow:"hidden",width:0,zIndex:e.options.zIndex}),e._contentInsert(),e.reposition(b,!0),f()?(e.$tooltip.addClass("tooltipster-"+e.options.animation).addClass("tooltipster-initial"),e.$tooltip.css({"-moz-animation-duration":e.options.animationDuration[0]+"ms","-ms-animation-duration":e.options.animationDuration[0]+"ms","-o-animation-duration":e.options.animationDuration[0]+"ms","-webkit-animation-duration":e.options.animationDuration[0]+"ms","animation-duration":e.options.animationDuration[0]+"ms","transition-duration":e.options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.state&&(e.$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.options.animationDuration[0]>0&&e.$tooltip.delay(e.options.animationDuration[0]),e.$tooltip.queue(i))},0)):e.$tooltip.css("display","none").fadeIn(e.options.animationDuration[0],i),e._trackerStart(),a(window).on("resize."+e.namespace+"-triggerClose",function(a){e.reposition(a)}).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)}),e.$originParents=e.$origin.parents(),e.$originParents.each(function(b,c){a(c).on("scroll."+e.namespace+"-triggerClose",function(a){e._scrollHandler(a)})}),e.options.triggerClose.mouseleave){n&&setTimeout(function(){"closed"!=e.state&&a("body").on("touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||e._close()})},0);var j=e.$origin,k=null;e.options.interactive&&(j=j.add(e.$tooltip)),j.on("mouseleave."+e.namespace+"-triggerClose",function(a){e.options.delay[1]?(k=setTimeout(function(){e._close(a)},e.options.delay[1]),e.timeouts.close.push(k)):e._close(a)}).on("mouseenter."+e.namespace+"-triggerClose",function(){clearTimeout(k)})}e.options.triggerClose.originClick&&e.$origin.on("click."+e.namespace+"-triggerClose",function(a){e._close(a)}),e.options.triggerClose.click&&setTimeout(function(){"closed"!=e.state&&a("body").on("click."+e.namespace+"-triggerClose touchstart."+e.namespace+"-triggerClose",function(b){e.options.interactive&&a.contains(e.$tooltip[0],b.target)||(e._close(b),"touchstart"!=b.type||e.$origin[0]!==b.target&&!a.contains(e.$origin[0],b.target)||(e.ignoreNextClick=!0,setTimeout(function(){e.ignoreNextClick=!1},500)))})},0),e._trigger("ready"),e.options.functionReady&&e.options.functionReady.call(e,e,{origin:e.$origin[0],tooltip:e.$tooltip[0]})}if(e.options.timer>0){var k=setTimeout(function(){e._close()},e.options.timer+h);e.timeouts.close.push(k)}}}},_optionsFormat:function(){"number"==typeof this.options.delay&&(this.options.delay=[this.options.delay,this.options.delay]),"number"==typeof this.options.animationDuration&&(this.options.animationDuration=[this.options.animationDuration,this.options.animationDuration]),"string"==typeof this.options.theme&&(this.options.theme=[this.options.theme]),"string"==typeof this.options.parent&&(this.options.parent=a(this.options.parent)),"hover"==this.options.trigger?(this.options.triggerOpen={hover:!0},this.options.triggerClose={mouseleave:!0,originClick:!0}):"click"==this.options.trigger&&(this.options.triggerOpen={click:!0},this.options.triggerClose={click:!0}),this._trigger("options")},_prepareGC:function(){var a=this;a.options.selfDestruction?a.garbageCollector=setInterval(function(){d(a.$origin)||a.destroy()},2e4):clearInterval(a.garbageCollector)},_prepareOrigin:function(){var a=this;a.$origin.off("."+a.namespace+"-triggerOpen"),a.options.triggerOpen.hover&&(a.$origin.on("mouseenter."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!0,a._open(b))}),n&&a.options.touchDevices&&a.$origin.on("touchstart."+a.namespace+"-triggerOpen",function(b){a._openNow(b)})),a.options.triggerOpen.click&&a.$origin.on("click."+a.namespace+"-triggerOpen",function(b){e()&&!a.options.touchDevices||a._openNow(b)}),a.options.triggerClose.mouseleave&&a.$origin.on("mouseleave."+a.namespace+"-triggerOpen",function(){e()&&!a.options.touchDevices||(a.mouseIsOverOrigin=!1)})},_prepareTooltip:function(){var b=this;b.$tooltip.attr("id",b.namespace),a.each(b.previousThemes,function(a,c){b.$tooltip.removeClass(c)}),a.each(b.options.theme,function(a,c){b.$tooltip.addClass(c)}),b.previousThemes=a.merge([],b.options.theme);var c=b.options.interactive?"auto":"";b.$tooltip.css("pointer-events",c)},_scrollHandler:function(b){var c=this;if(c.options.triggerClose.scroll)c._close(b);else{if(b.target===document)c.geometry.origin.fixedLineage||c.options.repositionOnScroll&&c.reposition(b);else{var d=c._geometry(),e=!1;if("fixed"!=c.$origin.css("position")&&c.$originParents.each(function(b,c){var f=a(c),g=f.css("overflow-x"),h=f.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(d.origin.windowOffset.lefti.right))return e=!0,!1;if("visible"!=h&&(d.origin.windowOffset.topi.bottom))return e=!0,!1}return"fixed"==f.css("position")?!1:void 0}),e)c.$tooltip.css("visibility","hidden");else if(c.$tooltip.css("visibility","visible"),c.options.repositionOnScroll)c.reposition(b);else{var f=d.origin.offset.left-c.geometry.origin.offset.left,g=d.origin.offset.top-c.geometry.origin.offset.top;c.$tooltip.css({left:c.tooltipCoord.left+f,top:c.tooltipCoord.top+g})}}c._trigger({type:"scroll",event:b})}},_stateSet:function(a){return this.state=a,this._trigger({type:"state",state:a}),this},_timeoutsClear:function(){clearTimeout(this.timeouts.open),this.timeouts.open=null,a.each(this.timeouts.close,function(a,b){clearTimeout(b)}),this.timeouts.close=[]},_trackerStart:function(){var a=this,b=a.$tooltip.find(".tooltipster-content");a.options.trackTooltip&&(a.contentBcr=b[0].getBoundingClientRect()),a.tracker=setInterval(function(){if(d(a.$origin)&&d(a.namespace)){if(a.options.trackOrigin){var e=a._geometry(),f=!1;c(e.origin.size,a.geometry.origin.size)&&(a.geometry.origin.fixedLineage?c(e.origin.windowOffset,a.geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.geometry.origin.offset)&&(f=!0)),f||(a.options.triggerClose.mouseleave?a._close():a.reposition())}if(a.options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.contentBcr.height&&g.width===a.contentBcr.width||(a.reposition(),a.contentBcr=g)}}else a._close()},a.options.trackerInterval)},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),a[0].instance=this,a[0].origin=this.$origin?this.$origin[0]:null,this.$emitterPrivate.trigger.apply(this.$emitterPrivate,a),i.trigger.apply(i,a),this.$emitterPublic.trigger.apply(this.$emitterPublic,a),this},_update:function(a){var b=this;if(b._contentSet(a),null!==b.Content){if("closed"!==b.state&&(b._contentInsert(),b.reposition(),b.options.updateAnimation))if(f()){var c=b.options.updateAnimation;b.$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.state&&b.$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b.$tooltip.fadeTo(200,.5,function(){"closed"!=b.state&&b.$tooltip.fadeTo(200,1)})}else b._close()},close:function(a){return this.destroyed?this._destroyError():this._close(null,a),this},content:function(a){return void 0===a?this.Content:(this.destroyed?this._destroyError():this._update(a),this)},destroy:function(){var b=this;return b.destroyed?b._destroyError():b.destroying||(b.destroying=!0,b._close(null,function(){b.destroying=!1,b.destroyed=!0,b._trigger("destroyed"),b._off(),b.off(),b.$origin.removeData(b.namespace).off("."+b.namespace+"-triggerOpen");var c=b.$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;if("previous"===b.options.restoration?d=b.$origin.data("tooltipster-initialTitle"):"current"===b.options.restoration&&(d="string"==typeof b.Content?b.Content:a("
").append(b.Content).html()),d&&b.$origin.attr("title",d),b.$origin.hasClass("tooltipstered"))b.$origin.removeClass("tooltipstered");else{var e=b.$origin.attr("class").replace("tooltipstered","");b.$origin.attr("class",e)}b.$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.namespace}),b.$origin.data("tooltipster-ns",c);b.Content=null,b.$origin=null,b.$emitterPrivate=null,b.$emitterPublic=null,b.$tooltip=null,b.options.parent=null,j=a.grep(j,function(a,c){return b!==a}),clearInterval(b.garbageCollector)})),b},disable:function(){return this.destroyed?void this._destroyError():(this._close(),this.enabled=!1,this)},elementOrigin:function(){return this.destroyed?void this._destroyError():this.$origin[0]},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:null},enable:function(){return this.enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.destroyed||this.$emitterPublic.off.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.destroyed?this._destroyError():this.$emitterPublic.on.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.destroyed?this._destroyError():this.$emitterPublic.one.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.destroyed||this.destroying?this._destroyError():this._openNow(null,a),this},option:function(b,c){return void 0===c?this.options[b]:(this.destroyed?this._destroyError():(this.options[b]=c,this._optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this._prepareOrigin(),"selfDestruction"===b&&this._prepareGC()),this)},reposition:function(a,b){var c=this;return c.destroyed?c._destroyError():(d(c.namespace)||b)&&(b||c.$tooltip.detach(),c.geometry=c._geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.destroyed,destroying:this.destroying,enabled:this.enabled,open:"closed"!==this.state,state:this.state}},triggerHandler:function(){return this.destroyed?this._destroyError():this.$emitterPublic.triggerHandler.apply(this.$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&"object"==typeof b[1]&&null!==b[1]&&!f.options.contentCloning&&f.options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}j=[];var e=b[0]&&void 0!==b[0].multiple,f=e&&b[0].multiple||!e&&h.multiple,g=b[0]&&void 0!==b[0].content,i=g&&b[0].content||!g&&h.content,k=b[0]&&void 0!==b[0].contentCloning,l=k&&b[0].contentCloning||!k&&h.contentCloning,m=b[0]&&void 0!==b[0].debug,n=m&&b[0].debug||!m&&h.debug;return this.length>1&&"object"==typeof i&&null!==i&&!l&&n&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),g=null;e?f?c=!0:n&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(g=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(g.namespace),d.data("tooltipster-ns",e),d.data(g.namespace,g),g.options.functionInit&&g.options.functionInit.call(g,g,{origin:this}),g._trigger("init")),j.push(g)}),this},b.prototype={_init:function(){this.$container=a('
').append(this.$tooltip).appendTo("body"),this.$tooltip.find(".tooltipster-content").css("overflow","auto")},_forceRedraw:function(){var a=this.$tooltip.parent();this.$tooltip.detach(),this.$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.$tooltip.css({display:"block",height:"",left:0,overflow:"auto",top:0,width:a}),this},destroy:function(){this.$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.$tooltip.css({display:"",height:"",left:0,overflow:"visible",top:0,width:""}),this},measure:function(){this._forceRedraw();var a=this.$tooltip[0].getBoundingClientRect(),b={size:{height:a.bottom,width:a.right}};if(this.constraints){var c=this.$tooltip.find(".tooltipster-content"),d=this.$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return p&&11>=p&&(b.size.width=Math.ceil(b.size.width)+1),b}};var m=!1;a("body").one("mousemove",function(){m=!0});var n=!!("ontouchstart"in window),o=navigator.userAgent.toLowerCase(),p=!1;-1!=o.indexOf("msie")?p=parseInt(o.split("msie")[1]):-1!==o.toLowerCase().indexOf("trident")&&-1!==o.indexOf(" rv:11")?p=11:-1!=o.toLowerCase().indexOf("edge/")&&(p=parseInt(o.toLowerCase().split("edge/")[1]))}(jQuery); \ No newline at end of file diff --git a/doc/images/tooltipster.svg b/doc/images/tooltipster.svg index cd43a09..c0632aa 100644 --- a/doc/images/tooltipster.svg +++ b/doc/images/tooltipster.svg @@ -1,212 +1,224 @@ - + - + + c0.531,0.076,0.973,0.146,1.32,0.21c0.354,0.067,0.688,0.135,1.002,0.201c0.315,0.067,0.76,0.139,1.333,0.215 + c-0.172,1.281-0.306,2.57-0.401,3.868c-0.096,1.299-0.143,2.522-0.143,3.668c0,2.457,0.137,4.694,0.397,6.737 + C97.832,43.991,96.657,44.853,95.534,45.601z M138.227,56.115c-0.021,0.478-0.043,1.073-0.072,1.791 + c-0.028,0.716-0.071,1.59-0.129,2.62c-0.039,0.593-0.063,1.262-0.071,2.007c-0.011,0.745-0.034,1.509-0.072,2.292 + c-0.039,0.783-0.086,1.547-0.144,2.293c-0.057,0.744-0.153,1.414-0.286,2.006c-0.134,0.591-0.306,1.063-0.516,1.418 + c-0.211,0.354-0.479,0.529-0.804,0.529c-0.361,0-0.668-0.133-0.916-0.4s-0.449-0.572-0.603-0.917s-0.262-0.688-0.329-1.03 + c-0.066-0.344-0.101-0.593-0.101-0.746c0-0.248,0.053-0.653,0.156-1.218c0.104-0.563,0.248-1.231,0.432-2.006 + c0.181-0.772,0.396-1.608,0.645-2.507c0.248-0.898,0.524-1.795,0.831-2.693c0.306-0.897,0.631-1.763,0.975-2.594 + c0.344-0.83,0.696-1.561,1.061-2.191C138.264,55.132,138.245,55.581,138.227,56.115z M144.158,47.349 + c0-1.127,0.032-2.259,0.101-3.396c0.066-1.137,0.182-2.229,0.345-3.281c0.162-1.049,0.373-2.034,0.63-2.951 + c0.258-0.917,0.582-1.709,0.975-2.378c0.393-0.667,0.854-1.198,1.391-1.59c0.533-0.392,1.154-0.588,1.86-0.588 + c0.631,0,1.123,0.178,1.478,0.53c0.353,0.354,0.602,0.779,0.745,1.275c0.143,0.497,0.199,1.027,0.172,1.59 + c-0.029,0.564-0.092,1.056-0.188,1.476c-0.229,0.898-0.535,1.776-0.917,2.635c-0.383,0.86-0.874,1.69-1.476,2.494 + c-0.603,0.802-1.317,1.558-2.148,2.263C146.293,46.136,145.303,46.774,144.158,47.349z M171.521,47.963 + c-0.115,0.545-0.315,1.022-0.604,1.433c-0.285,0.412-0.673,0.742-1.16,0.989c-0.485,0.249-1.103,0.373-1.849,0.373 + c-0.611,0-1.155-0.144-1.632-0.431c-0.479-0.286-0.899-0.602-1.262-0.945c-0.363-0.343-0.684-0.658-0.959-0.945 + c-0.048-0.047-0.091-0.084-0.136-0.123l-0.042-0.887l6.781-6.756c0.095,0.309,0.205,0.674,0.329,1.104 + c0.124,0.431,0.238,0.89,0.344,1.377c0.104,0.486,0.19,0.998,0.258,1.533c0.066,0.534,0.102,1.06,0.102,1.574 + C171.693,46.853,171.635,47.419,171.521,47.963z M214.214,40.354c0.037-0.589,0.118-1.203,0.243-1.833 + c0.124-0.631,0.307-1.255,0.545-1.877c0.238-0.621,0.554-1.174,0.945-1.662c0.391-0.487,0.878-0.882,1.461-1.188 + c0.583-0.305,1.284-0.459,2.106-0.459c0.458,0,0.845,0.277,1.159,0.831c0.315,0.555,0.474,1.262,0.474,2.121 + c0,0.611-0.239,1.242-0.717,1.891c-0.478,0.65-1.064,1.252-1.763,1.806c-0.696,0.554-1.452,1.009-2.264,1.359 + c-0.813,0.354-1.562,0.529-2.249,0.529C214.156,41.455,214.175,40.95,214.214,40.354z"/> - - + + + + + + diff --git a/doc/js/scripts.js b/doc/js/scripts.js index 4f203d8..66ba595 100644 --- a/doc/js/scripts.js +++ b/doc/js/scripts.js @@ -33,7 +33,6 @@ $(function() { '' ), // setting a same value to minWidth and maxWidth will result in a fixed width - minWidth: 400, maxWidth: 400, side: 'right' }); diff --git a/package.json b/package.json index c3028c8..909c644 100644 --- a/package.json +++ b/package.json @@ -38,5 +38,5 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "version": "4.0.0rc43" + "version": "4.0.0rc44" } diff --git a/src/js/core.js b/src/js/core.js index c0d0cc5..7c43caf 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -284,6 +284,8 @@ this.geometry; // proxy the variable for display plugins who may use it this.IE = IE; + // to fix a touch issue + this.ignoreNextClick = false; this.mouseIsOverOrigin = false; // a unique namespace per instance this.namespace = 'tooltipster-'+ Math.round(Math.random()*100000); @@ -294,7 +296,7 @@ this.$originParents; // to remove themes if needed this.previousThemes = []; - // the state can be either : appearing, stable, disappearing, closed + // the state can be either: appearing, stable, disappearing, closed this.state = 'closed'; // timeout references this.timeouts = { @@ -325,7 +327,7 @@ // some options may need to be reformatted self._optionsFormat(); - // note : the content is null (empty) by default and can stay that + // note: the content is null (empty) by default and can stay that // way if the plugin remains initialized but not fed any content. The // tooltip will just not appear. @@ -347,7 +349,7 @@ // If content is provided in the options, it has precedence over the // title attribute. - // Note : an empty string is considered content, only 'null' represents + // Note: an empty string is considered content, only 'null' represents // the absence of content. // Also, an existing title="" attribute will result in an empty string // content @@ -634,7 +636,7 @@ // clone if asked. Cloning the object makes sure that each instance has its // own version of the content (in case a same object were provided for several // instances) - // reminder : typeof null === object + // reminder: typeof null === object if (content instanceof $ && this.options.contentCloning) { content = content.clone(true); } @@ -1018,8 +1020,11 @@ var self = this; - // if the destruction process has not begun - if (!self.destroying) { + // if the destruction process has not begun and if this was not + // triggered by an unwanted emulated click event + if ( !self.destroying + && (!event || !self.ignoreNextClick) + ) { // check that the origin is still in the DOM if (bodyContains(self.$origin)) { @@ -1233,7 +1238,7 @@ // if the user touches the body, close if (deviceHasTouchCapability) { - // timeout 0 : to prevent immediate closing if the method was called + // timeout 0: to prevent immediate closing if the method was called // on a click event and if options.delay == 0 (because of bubbling) setTimeout(function() { @@ -1298,14 +1303,37 @@ // to close the tooltip if (self.options.triggerClose.click) { - // explanations : same as above + // explanations: same as above setTimeout(function() { if (self.state != 'closed') { $('body').on('click.'+ self.namespace +'-triggerClose touchstart.'+ self.namespace +'-triggerClose', function(event) { if (!self.options.interactive || !$.contains(self.$tooltip[0], event.target)) { + self._close(event); + + // the touchstart event is about to be emulated into a click event. But now the + // tooltip is closed, if this emulated click happens on the origin, it will open + // the tooltip again right away (at least in Safari, not sure why the other + // browsers decide not to reopen it). We could call event.preventDefault() to + // prevent the emulation but it could also prevent browser normal behaviors like + // scrolling or zooming, so we'll let the click be triggered and just ignore it + // in ::_openNow() + if ( event.type == 'touchstart' + && ( self.$origin[0] === event.target + || $.contains(self.$origin[0], event.target) + ) + ) { + + self.ignoreNextClick = true; + + // the emulated click is triggered a crazy long time after the touch event, + // at least on an iPhone4 + setTimeout(function() { + self.ignoreNextClick = false; + }, 500); + } } }); } @@ -1410,9 +1438,9 @@ // in case we're resetting the triggers self.$origin.off('.'+ self.namespace +'-triggerOpen'); - // for 'click' and 'hover' open triggers : bind on events to open the tooltip. + // for 'click' and 'hover' open triggers: bind on events to open the tooltip. // Closing is now handled in _openNow() because of its bindings. - // Notes about touch events : + // Notes about touch events: // - mouseenter, mouseleave and clicks happen even on pure touch devices // because they are emulated. deviceIsPureTouch() is a simple attempt // to detect them. @@ -1443,8 +1471,8 @@ if (self.options.triggerOpen.click) { - // note : for touch devices, we do not bind on touchstart, we only rely - // on the emulated clicks (triggered by taps) + // note: for touch devices, we do not bind on touchstart, we only rely + // on the emulated clicks (emulated after touchstart) self.$origin.on('click.'+ self.namespace +'-triggerOpen', function(event) { if (!deviceIsPureTouch() || self.options.touchDevices) { self._openNow(event); @@ -2172,7 +2200,7 @@ // for using in closures var args = Array.prototype.slice.apply(arguments), - // common mistake : an HTML element can't be in several tooltips at the same time + // common mistake: an HTML element can't be in several tooltips at the same time contentCloningWarning = 'You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.'; // this happens with $(sel).tooltipster(...) when $(sel) does not match anything @@ -2347,7 +2375,7 @@ /** * Move the tooltip into an invisible div that does not allow overflow to make - * size tests. Note : the tooltip may or may not be attached to the DOM at the + * size tests. Note: the tooltip may or may not be attached to the DOM at the * moment this method is called, it does not matter. */ _init: function() { @@ -2370,7 +2398,7 @@ */ _forceRedraw: function() { - // note : this would work but for Webkit only + // note: this would work but for Webkit only //this.$tooltip.close(); //this.$tooltip[0].offsetHeight; //this.$tooltip.open(); diff --git a/src/js/plugins/tooltipster/sideTip/sideTip.js b/src/js/plugins/tooltipster/sideTip/sideTip.js index 21e2f0a..44bd306 100644 --- a/src/js/plugins/tooltipster/sideTip/sideTip.js +++ b/src/js/plugins/tooltipster/sideTip/sideTip.js @@ -735,6 +735,16 @@ var target, rects = this.instance.$origin[0].getClientRects(); + // these lines fix a Chrome bug (issue #491) + if (rects.length > 1) { + var opacity = this.instance.$origin.css('opacity'); + if(opacity == 1) { + this.instance.$origin.css('opacity', 0.99); + rects = this.instance.$origin[0].getClientRects(); + this.instance.$origin.css('opacity', 1); + } + } + // by default, the target will be the middle of the origin if (rects.length < 2) {