witten
/
luminotes
Archived
1
0
Fork 0

Pulldowns for search suggestions, importing, and exporting now show up. Worked around yet another WebKit bug/misfeature.

This commit is contained in:
Dan Helfman 2008-10-06 17:56:41 -07:00
parent 5944d1f20d
commit abd5a2a189
2 changed files with 15 additions and 1 deletions

2
NEWS
View File

@ -2,7 +2,7 @@
* Safari and Chrome web browsers are now supported (beta):
* You can now create and end links.
* Underline and strikethrough now work.
*
* Pulldowns for search suggestions, importing, and exporting show up.
1.5.2: October 1, 2008
* Leading/trailing spaces in note titles are now ignored when making links

View File

@ -2855,6 +2855,20 @@ function calculate_position( node, anchor, relative_to, always_left_align ) {
// position the pulldown under the anchor
var position = getElementPosition( anchor );
// in WebKit, work around a bug in which children/grandchildren/etc of relatively positioned
// elements have an incorrect position
if ( WEBKIT ) {
var parent_node = anchor.parentNode;
while ( parent_node ) {
if ( getStyle( parent_node, "position" ) == "relative" ) {
position.x -= parent_node.offsetLeft;
position.y -= parent_node.offsetTop;
break;
}
parent_node = parent_node.parentNode;
}
}
if ( relative_to ) {
var relative_pos = getElementPosition( relative_to );
if ( relative_pos ) {