witten
/
luminotes
Archived
1
0
Fork 0

Modified the WebKit pulldown positioning code so that changes and options pulldowns show up in the correct location.

This commit is contained in:
Dan Helfman 2008-10-07 14:52:32 -07:00
parent a91136d27d
commit 8c7f05801c
1 changed files with 6 additions and 2 deletions

View File

@ -2856,11 +2856,15 @@ function calculate_position( node, anchor, relative_to, always_left_align ) {
var position = getElementPosition( anchor );
// in WebKit, work around a bug in which children/grandchildren/etc of relatively positioned
// elements have an incorrect position
// elements inside of fixed position elements have an incorrect position
if ( WEBKIT ) {
var parent_node = anchor.parentNode;
var found_fixed_parent = false;
while ( parent_node ) {
if ( getStyle( parent_node, "position" ) == "relative" ) {
if ( getStyle( parent_node, "position" ) == "fixed" )
found_fixed_parent = true;
else if ( found_fixed_parent && getStyle( parent_node, "position" ) == "relative" ) {
position.x -= parent_node.offsetLeft;
position.y -= parent_node.offsetTop;
break;