@@ -110,6 +110,7 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position'])
110
110
'animation="animation" ' +
111
111
'is-open="isOpen"' +
112
112
'origin-scope="origScope" ' +
113
+ 'style="visibility: hidden"' +
113
114
'>' +
114
115
'</div>' ;
115
116
@@ -132,12 +133,13 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position'])
132
133
var isOpenExp = angular . isDefined ( attrs [ prefix + 'IsOpen' ] ) ? $parse ( attrs [ prefix + 'IsOpen' ] ) : false ;
133
134
134
135
var positionTooltip = function ( ) {
135
- if ( ! tooltip ) { return ; }
136
+ // check if tooltip exists and is not empty
137
+ if ( ! tooltip || ! tooltip . html ( ) ) { return ; }
136
138
137
139
if ( ! positionTimeout ) {
138
140
positionTimeout = $timeout ( function ( ) {
139
141
// Reset the positioning and box size for correct width and height values.
140
- tooltip . css ( { top : 0 , left : 0 , width : 'auto' , height : 'auto' } ) ;
142
+ tooltip . css ( { top : 0 , left : 0 , width : 'auto' , height : 'auto' , visibility : 'hidden' } ) ;
141
143
142
144
var ttBox = $position . position ( tooltip ) ;
143
145
var ttCss = $position . positionElements ( element , tooltip , ttScope . placement , appendToBody ) ;
@@ -227,8 +229,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position'])
227
229
ttScope . $apply ( ) ; // digest required as $apply is not called
228
230
}
229
231
230
- tooltip . css ( { display : 'block' , visibility : 'hidden' } ) ;
231
-
232
232
positionTooltip ( ) ;
233
233
}
234
234
0 commit comments