Skip to content

Commit

Permalink
fix(tooltip): fix positioning error when appendToBody is set to true
Browse files Browse the repository at this point in the history
Closes angular-ui#387

use offset function instead position function when appednToBody is set to true
  • Loading branch information
bowenisdum authored and pkozlowski-opensource committed May 4, 2013
1 parent d87ed0e commit 76fee1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
} else {
element.after( tooltip );
}

// Get the position of the directive element.
position = $position.position( element );
position = options.appendToBody ? $position.offset( element ) : $position.position( element );

// Get the height and width of the tooltip so we can center it.
ttWidth = tooltip.prop( 'offsetWidth' );
Expand Down

0 comments on commit 76fee1f

Please sign in to comment.