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

Commit 76fee1f

Browse files
bowenisdumpkozlowski-opensource
authored andcommitted
fix(tooltip): fix positioning error when appendToBody is set to true
Closes #387 use offset function instead position function when appednToBody is set to true
1 parent d87ed0e commit 76fee1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tooltip/tooltip.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
167167
} else {
168168
element.after( tooltip );
169169
}
170-
170+
171171
// Get the position of the directive element.
172-
position = $position.position( element );
172+
position = options.appendToBody ? $position.offset( element ) : $position.position( element );
173173

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

0 commit comments

Comments
 (0)