Skip to content

Commit 41eea51

Browse files
committed
fix(tooltip): respect animate attribute
Previously, it was only possible to set animation to false with an empty string and options.
1 parent 0b39994 commit 41eea51

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/tooltip/test/tooltip.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ describe('tooltip', function() {
4545
expect( elmScope.tt_isOpen ).toBe( false );
4646
}));
4747

48+
it('should not animate on animation set to false', inject(function() {
49+
expect( elmScope.tt_animation ).toBe( false );
50+
}));
51+
4852
it('should have default placement of "top"', inject(function() {
4953
elm.trigger( 'mouseenter' );
5054
expect( elmScope.tt_placement ).toBe( "top" );

src/tooltip/tooltip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
262262
});
263263

264264
attrs.$observe(prefix + 'Animation', function (val) {
265-
scope.tt_animation = angular.isDefined(val) ? !!val : options.animation;
265+
var shouldAnimate = val !== 'false';
266+
scope.tt_animation = angular.isDefined(val) ? shouldAnimate : options.animation;
266267
});
267268

268269
attrs.$observe( prefix+'PopupDelay', function ( val ) {

0 commit comments

Comments
 (0)