Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(tooltip): respect animation attribute #1454

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 3 additions & 4 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
scope.tt_placement = angular.isDefined( val ) ? val : options.placement;
});

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

attrs.$observe( prefix+'PopupDelay', function ( val ) {
var delay = parseInt( val, 10 );
scope.tt_popupDelay = ! isNaN(delay) ? delay : options.popupDelay;
Expand Down Expand Up @@ -292,6 +288,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
hasRegisteredTriggers = true;
});

var animation = scope.$eval(attrs[prefix + 'Animation']);
scope.tt_animation = angular.isDefined(animation) ? !!animation : options.animation;

attrs.$observe( prefix+'AppendToBody', function ( val ) {
appendToBody = angular.isDefined( val ) ? $parse( val )( scope ) : appendToBody;
});
Expand Down