witten
/
luminotes
Archived
1
0
Fork 0

Safari/Chrome: Pulldowns on inline images are now positioned correctly.

This commit is contained in:
Dan Helfman 2008-10-08 14:56:01 -07:00
parent f1d814cfd6
commit a1ffcfb9b8
2 changed files with 10 additions and 4 deletions

1
NEWS
View File

@ -3,6 +3,7 @@
* You can now create and end links.
* Underline and strikethrough now work.
* Pulldowns for search suggestions, importing, and exporting show up.
* Pulldowns on inline images are now positioned correctly.
* Note resizing (growing and shrinking) works as expected.
* Improved page loading speed and fixed a rare session locking timeout bug
by removing all implicit session locking.

View File

@ -2854,10 +2854,15 @@ Pulldown.prototype.finish_init = function () {
function calculate_position( node, anchor, relative_to, always_left_align ) {
var anchor_dimensions = getElementDimensions( anchor );
// if the anchor has no height, use its first child (if any) instead
if ( anchor_dimensions.h == 0 && anchor.firstChild ) {
anchor = anchor.firstChild;
anchor_dimensions = getElementDimensions( anchor );
// if the anchor's first child is larger (vertically) than its parent, then use it as the anchor
if ( anchor.firstChild ) {
try{
var child_dimensions = getElementDimensions( anchor.firstChild );
if ( child_dimensions.h > anchor_dimensions.h ) {
anchor = anchor.firstChild;
anchor_dimensions = child_dimensions;
}
} catch ( e ) {}
}
// position the pulldown under the anchor