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

Commit

Permalink
fix(popover): correctly position popovers appended to body
Browse files Browse the repository at this point in the history
Closes #682
  • Loading branch information
pkozlowski-opensource committed Jul 23, 2013
1 parent 56f624a commit 93a82af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/position/test/test.html
Expand Up @@ -67,14 +67,14 @@ <h3>Within relative-positioned DIV</h3>

<h3>Within absolute-positioned DIV</h3>

<div style="position: absolute; left: 400px" class="container">
<div class="content" position>Content</div>
<div style="position: absolute; left: 400px; top: 400px" class="container">
<div class="content" position>Content - absolute</div>
</div>

<h3>Within overflowing absolute-positioned DIV</h3>
<div class="container" style="height: 50px; overflow: scroll;overflow-x: hidden; position: absolute;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non velit nulla. Suspendisse sit amet tempus diam. Sed at ultricies neque. Suspendisse id felis a sem placerat ornare. Donec auctor, purus at molestie tempor, arcu enim molestie lacus, ac imperdiet massa urna eu massa. Praesent velit tellus, scelerisque a fermentum ut, ornare in diam. Phasellus egestas molestie feugiat. Vivamus sit amet viverra metus.
<div class="content" position>Content</div>
<div class="content" position>Content absolute overflow</div>
</div>

<br>
Expand Down
2 changes: 1 addition & 1 deletion src/tooltip/tooltip.js
Expand Up @@ -181,7 +181,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
}

// Get the position of the directive element.
position = options.appendToBody ? $position.offset( element ) : $position.position( element );
position = 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 93a82af

Please sign in to comment.