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

Commit

Permalink
fix(tooltip): incorrect position when text wraps
Browse files Browse the repository at this point in the history
The $digest that was removed in 32c470 is actually necessary to get the
tooltip contents rendered. The rendered content is important when the
tooltip is on the right edge. See Plunker in #2995:
http://plnkr.co/edit/8GZ5F5zj3Xe6IinXQz74?p=preview

Reverts change in 32c470 (#2995) but fixes it in another way.

Fixes #2995
Fixes #2992
Fixes #2951
Closes #2996
  • Loading branch information
chrisirhc committed Feb 20, 2015
1 parent da31a4f commit 5726e3e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap

// Set the initial positioning.
tooltip.css({ top: 0, left: 0, display: 'block' });

// Now we add it to the DOM because need some info about it. But it's not
// visible yet anyway.
if ( appendToBody ) {
$document.find( 'body' ).append( tooltip );
} else {
element.after( tooltip );
}
ttScope.$digest();

positionTooltip();

Expand Down Expand Up @@ -236,7 +229,13 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
removeTooltip();
}
tooltipLinkedScope = ttScope.$new();
tooltip = tooltipLinker(tooltipLinkedScope, angular.noop);
tooltip = tooltipLinker(tooltipLinkedScope, function (tooltip) {
if ( appendToBody ) {
$document.find( 'body' ).append( tooltip );
} else {
element.after( tooltip );
}
});
}

function removeTooltip() {
Expand Down

0 comments on commit 5726e3e

Please sign in to comment.