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

fix(tooltip): evaluate appendToBody on init #2921

Closed
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
7 changes: 3 additions & 4 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
* Returns the actual instance of the $tooltip service.
* TODO support multiple triggers
*/
this.$get = [ '$window', '$compile', '$timeout', '$parse', '$document', '$position', '$interpolate', function ( $window, $compile, $timeout, $parse, $document, $position, $interpolate ) {
this.$get = [ '$window', '$compile', '$timeout', '$document', '$position', '$interpolate', function ( $window, $compile, $timeout, $document, $position, $interpolate ) {
return function $tooltip ( type, prefix, defaultTriggerShow ) {
var options = angular.extend( {}, defaultOptions, globalOptions );

Expand Down Expand Up @@ -299,9 +299,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
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;
});
var appendToBodyVal = scope.$eval(attrs[prefix + 'AppendToBody']);
appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;

// if a tooltip is attached to <body> we need to remove it on
// location change as its parent scope will probably not be destroyed
Expand Down