@@ -89,7 +89,7 @@ var defaults = {
8989 hasTransitions : transitionSupport ( ) ,
9090 IE : false ,
9191 // don't set manually, it will be updated by a build task after the manifest
92- semVer : '4.1.2 ' ,
92+ semVer : '4.1.5 ' ,
9393 window : win
9494 } ,
9595 core = function ( ) {
@@ -875,8 +875,8 @@ $.Tooltipster.prototype = {
875875 geo . origin . windowOffset . right = geo . origin . windowOffset . left + geo . origin . size . width ;
876876 geo . origin . windowOffset . bottom = geo . origin . windowOffset . top + geo . origin . size . height ;
877877
878- geo . origin . offset . left = geo . origin . windowOffset . left + env . window . scrollX ;
879- geo . origin . offset . top = geo . origin . windowOffset . top + env . window . scrollY ;
878+ geo . origin . offset . left = geo . origin . windowOffset . left + geo . window . scroll . left ;
879+ geo . origin . offset . top = geo . origin . windowOffset . top + geo . window . scroll . top ;
880880 geo . origin . offset . bottom = geo . origin . offset . top + geo . origin . size . height ;
881881 geo . origin . offset . right = geo . origin . offset . left + geo . origin . size . width ;
882882
@@ -1555,7 +1555,8 @@ $.Tooltipster.prototype = {
15551555 // call our constructor custom callback function
15561556 if ( self . __options . functionAfter ) {
15571557 self . __options . functionAfter . call ( self , self , {
1558- event : event
1558+ event : event ,
1559+ origin : self . _$origin [ 0 ]
15591560 } ) ;
15601561 }
15611562
@@ -2786,27 +2787,31 @@ $.Tooltipster.prototype = {
27862787
27872788 if ( ! self . __destroyed ) {
27882789
2789- // if the tooltip has not been removed from DOM manually (or if it
2790- // has been detached on purpose)
2791- if ( bodyContains ( self . _$tooltip ) || tooltipIsDetached ) {
2792-
2793- if ( ! tooltipIsDetached ) {
2794- // detach in case the tooltip overflows the window and adds
2795- // scrollbars to it, so __geometry can be accurate
2796- self . _$tooltip . detach ( ) ;
2797- }
2790+ // if the tooltip is still open and the origin is still in the DOM
2791+ if ( self . __state != 'closed' && bodyContains ( self . _$origin ) ) {
27982792
2799- // refresh the geometry object before passing it as a helper
2800- self . __Geometry = self . __geometry ( ) ;
2801-
2802- // let a plugin fo the rest
2803- self . _trigger ( {
2804- type : 'reposition' ,
2805- event : event ,
2806- helper : {
2807- geo : self . __Geometry
2793+ // if the tooltip has not been removed from DOM manually (or if it
2794+ // has been detached on purpose)
2795+ if ( tooltipIsDetached || bodyContains ( self . _$tooltip ) ) {
2796+
2797+ if ( ! tooltipIsDetached ) {
2798+ // detach in case the tooltip overflows the window and adds
2799+ // scrollbars to it, so __geometry can be accurate
2800+ self . _$tooltip . detach ( ) ;
28082801 }
2809- } ) ;
2802+
2803+ // refresh the geometry object before passing it as a helper
2804+ self . __Geometry = self . __geometry ( ) ;
2805+
2806+ // let a plugin fo the rest
2807+ self . _trigger ( {
2808+ type : 'reposition' ,
2809+ event : event ,
2810+ helper : {
2811+ geo : self . __Geometry
2812+ }
2813+ } ) ;
2814+ }
28102815 }
28112816 }
28122817 else {
@@ -3229,8 +3234,13 @@ Ruler.prototype = {
32293234 result . fits = fits . height && fits . width ;
32303235 }
32313236
3232- // old versions of IE get the width wrong for some reason
3233- if ( env . IE && env . IE <= 11 ) {
3237+ // old versions of IE get the width wrong for some reason and it causes
3238+ // the text to be broken to a new line, so we round it up. If the width
3239+ // is the width of the screen though, we can assume it is accurate.
3240+ if ( env . IE
3241+ && env . IE <= 11
3242+ && result . size . width !== env . window . document . documentElement . clientWidth
3243+ ) {
32343244 result . size . width = Math . ceil ( result . size . width ) + 1 ;
32353245 }
32363246
@@ -3566,7 +3576,13 @@ $.tooltipster._plugin({
35663576 var $clone = self . __instance . _$tooltip . clone ( ) ,
35673577 // start position tests session
35683578 ruler = $ . tooltipster . _getRuler ( $clone ) ,
3569- satisfied = false ;
3579+ satisfied = false ,
3580+ animation = self . __instance . option ( 'animation' ) ;
3581+
3582+ // an animation class could contain properties that distort the size
3583+ if ( animation ) {
3584+ $clone . removeClass ( 'tooltipster-' + animation ) ;
3585+ }
35703586
35713587 // start evaluating scenarios
35723588 $ . each ( [ 'window' , 'document' ] , function ( i , container ) {
0 commit comments