Skip to content

Commit

Permalink
fix(tooltip): respect animate attribute
Browse files Browse the repository at this point in the history
Previously, it was only possible to set animation to false with an empty
string and options.
  • Loading branch information
chrisirhc committed Dec 23, 2013
1 parent 0b39994 commit 41eea51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/tooltip/test/tooltip.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ describe('tooltip', function() {
expect( elmScope.tt_isOpen ).toBe( false );
}));

it('should not animate on animation set to false', inject(function() {
expect( elmScope.tt_animation ).toBe( false );
}));

it('should have default placement of "top"', inject(function() {
elm.trigger( 'mouseenter' );
expect( elmScope.tt_placement ).toBe( "top" );
Expand Down
3 changes: 2 additions & 1 deletion src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
});

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

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

0 comments on commit 41eea51

Please sign in to comment.