diff --git a/src/tooltip/test/tooltip.spec.js b/src/tooltip/test/tooltip.spec.js index cac92712f2..01f6423fe7 100644 --- a/src/tooltip/test/tooltip.spec.js +++ b/src/tooltip/test/tooltip.spec.js @@ -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" ); diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index 3176f96902..99a9c2bee7 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -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; @@ -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; });