File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,10 @@ const Tooltip = (($) => {
358
358
359
359
$ ( tip ) . removeClass ( ClassName . SHOW )
360
360
361
+ this . _activeTrigger [ Trigger . CLICK ] = false
362
+ this . _activeTrigger [ Trigger . FOCUS ] = false
363
+ this . _activeTrigger [ Trigger . HOVER ] = false
364
+
361
365
if ( Util . supportsTransitionEnd ( ) &&
362
366
$ ( this . tip ) . hasClass ( ClassName . FADE ) ) {
363
367
this . _isTransitioning = true
Original file line number Diff line number Diff line change @@ -818,4 +818,25 @@ $(function () {
818
818
} )
819
819
} )
820
820
821
+ QUnit . test ( 'should show on first trigger after hide' , function ( assert ) {
822
+ assert . expect ( 3 )
823
+ var $el = $ ( '<a href="#" rel="tooltip" title="Test tooltip"/>' )
824
+ . appendTo ( '#qunit-fixture' )
825
+ . bootstrapTooltip ( { trigger : 'click hover focus' , animation : false } )
826
+
827
+ var tooltip = $el . data ( 'bs.tooltip' )
828
+ var $tooltip = $ ( tooltip . getTipElement ( ) )
829
+
830
+ function showingTooltip ( ) { return $tooltip . hasClass ( 'show' ) || tooltip . _hoverState === 'show' }
831
+
832
+ $el . trigger ( 'click' )
833
+ assert . ok ( showingTooltip ( ) , 'tooltip is faded in' )
834
+
835
+ $el . bootstrapTooltip ( 'hide' )
836
+ assert . ok ( ! showingTooltip ( ) , 'tooltip was faded out' )
837
+
838
+ $el . trigger ( 'click' )
839
+ assert . ok ( showingTooltip ( ) , 'tooltip is faded in again' )
840
+ } )
841
+
821
842
} )
You can’t perform that action at this time.
0 commit comments