Fixed a Chrome/Safari bug in which popups such as those for export and color were not positioned correctly if the page was scrolled past the top. Fixed a bug in which certain popups on the left and right side of the page scrolled along with the page instead of staying fixed in place.
This commit is contained in:
parent
24a3a7425a
commit
45f2042e48
5
NEWS
5
NEWS
|
@ -1,5 +1,8 @@
|
||||||
1.6.13:
|
1.6.13:
|
||||||
*
|
* Fixed a Chrome/Safari bug in which popups such as those for export and
|
||||||
|
color were not positioned correctly if the page was scrolled past the top.
|
||||||
|
* Fixed a bug in which certain popups on the left and right side of the page
|
||||||
|
scrolled along with the page instead of staying fixed in place.
|
||||||
|
|
||||||
1.6.12: May 19, 2009
|
1.6.12: May 19, 2009
|
||||||
* Added a toolbar color button for setting text and background colors.
|
* Added a toolbar color button for setting text and background colors.
|
||||||
|
|
|
@ -876,6 +876,8 @@ Wiki.prototype.resize_editor = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
Wiki.prototype.resize_toolbar = function () {
|
Wiki.prototype.resize_toolbar = function () {
|
||||||
|
this.clear_pulldowns();
|
||||||
|
|
||||||
var last_toolbar_button = getElement( "insertOrderedList" );
|
var last_toolbar_button = getElement( "insertOrderedList" );
|
||||||
var current_toolbar_bottom = getElementPosition( last_toolbar_button ).y + getElementDimensions( last_toolbar_button ).h;
|
var current_toolbar_bottom = getElementPosition( last_toolbar_button ).y + getElementDimensions( last_toolbar_button ).h;
|
||||||
var viewport_size = getViewportDimensions();
|
var viewport_size = getViewportDimensions();
|
||||||
|
@ -3244,25 +3246,25 @@ function calculate_position( node, anchor, relative_to, always_left_align ) {
|
||||||
} catch ( e ) {}
|
} catch ( e ) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// position the pulldown under the anchor
|
var parent_node = anchor.parentNode;
|
||||||
var position = getElementPosition( anchor );
|
var fixed_parent = null;
|
||||||
|
|
||||||
// in WebKit, work around a bug in which children/grandchildren/etc of relatively positioned
|
// determine whether this node has an ancentor node that has a fixed position
|
||||||
// elements inside of fixed position elements have an incorrect position
|
while ( parent_node && parent_node.nodeName != "#document" ) {
|
||||||
if ( WEBKIT ) {
|
if ( getStyle( parent_node, "position" ) == "fixed" ) {
|
||||||
var parent_node = anchor.parentNode;
|
fixed_parent = parent_node;
|
||||||
var found_fixed_parent = false;
|
break;
|
||||||
|
|
||||||
while ( parent_node ) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
parent_node = parent_node.parentNode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parent_node = parent_node.parentNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// position the pulldown under the anchor relative to the fixed ancestor (if any)
|
||||||
|
var position = getElementPosition( anchor, fixed_parent );
|
||||||
|
if ( fixed_parent ) {
|
||||||
|
position.x += fixed_parent.offsetLeft;
|
||||||
|
position.y += fixed_parent.offsetTop;
|
||||||
|
setStyle( node, { "position": "fixed" } )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( relative_to ) {
|
if ( relative_to ) {
|
||||||
|
|
Reference in New Issue