File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -928,6 +928,36 @@ $(function () {
928
928
$tooltip . trigger ( 'mouseenter' )
929
929
} )
930
930
931
+ test ( 'should hide tip after hide delay even if moused left before end of fade in' , function ( ) {
932
+ stop ( )
933
+
934
+ var $tooltip = $ ( '<a href="#" rel="tooltip" title="Another tooltip for test"/>' )
935
+ . appendTo ( '#qunit-fixture' )
936
+ . bootstrapTooltip ( { delay : { show : 10 , hide : 10 } } )
937
+
938
+ setTimeout ( function ( ) {
939
+ ok ( ! $tooltip . data ( 'bs.tooltip' ) . $tip , '1ms: tooltip exists' )
940
+
941
+ setTimeout ( function ( ) {
942
+ ok ( $tooltip . data ( 'bs.tooltip' ) . $tip . is ( '.fade.in' ) , '10ms: tooltip faded in' )
943
+ } , 10 )
944
+
945
+ setTimeout ( function ( ) {
946
+ ok ( $tooltip . data ( 'bs.tooltip' ) . $tip . is ( '.fade.in' ) , '15ms: tooltip faded in' )
947
+
948
+ $tooltip . trigger ( 'mouseout' )
949
+ } , 15 )
950
+
951
+ setTimeout ( function ( ) {
952
+ ok ( ! $tooltip . data ( 'bs.tooltip' ) . $tip . is ( '.fade.in' ) , '30ms: tooltip faded out' )
953
+
954
+ start ( )
955
+ } , 30 )
956
+ } , 0 )
957
+
958
+ $tooltip . trigger ( 'mouseenter' )
959
+ } )
960
+
931
961
test ( 'should correctly position tooltips on SVG elements' , function ( ) {
932
962
if ( ! window . SVGElement ) {
933
963
// Skip IE8 since it doesn't support SVG
Original file line number Diff line number Diff line change 207
207
this . applyPlacement ( calculatedOffset , placement )
208
208
209
209
var complete = function ( ) {
210
+ var prevHoverState = that . hoverState
210
211
that . $element . trigger ( 'shown.bs.' + that . type )
211
212
that . hoverState = null
213
+
214
+ if ( prevHoverState == 'out' ) that . leave ( that )
212
215
}
213
216
214
217
$ . support . transition && this . $tip . hasClass ( 'fade' ) ?
You can’t perform that action at this time.
0 commit comments