From 8c7f05801ce7de7af95eb34e04f1df534d361ff1 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 7 Oct 2008 14:52:32 -0700 Subject: [PATCH] Modified the WebKit pulldown positioning code so that changes and options pulldowns show up in the correct location. --- static/js/Wiki.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 20eeca1..51003d8 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -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;