Re: Safari Fix

Glen Stampoultzis <[email protected]> Tue, 15 Feb 2005 12:53:34 +1100
Newsgroups gmane.comp.krysalis.metamorphosis.sandbox
Message-ID <[email protected]>
Many thanks,

I have no way to test on Mac so this is exactly the sort of patches I 
was hoping to receive.  I'll commit the changes to CVS when I have a 
spare moment.

Regards,

Glen Stampoultzis

David Findley wrote:

>I just downloaded Krysalis 0.1 and it looks pretty
>good, but it didn't work properly in Safari.  The
>primary cause seems to be that offsetWidth and
>offsetTop are 0 in the table rows used to draw the
>menu (I don't know why, that's just what I found). 
>Anyway, here's what I did to fix it, and still have it
>work in IE on Windows, and FireFox on Mac and Windows:
>
>In MenuItem.script, in function "function initItem(
>buttonElement, submenuElement )", in the first "if
>(submenmuElement)" block I changed the existing code
>from this:
>
>if (submenuElement)
>{
>	submenuElement.style.top = (topMargin(buttonElement))
>+ "px";
>	submenuElement.style.left =
>(leftMargin(buttonElement) + buttonElement.offsetWidth
>- 9) + "px";
>	addClass( submenuElement, "menuDropDivVisible" );
>	currentSubmenu = submenuElement;
>}
>
>to this:
>
>if (submenuElement)
>{
>	// get top starting from _any_ TD inside the TR
>(instead of the TR)
>	submenuElement.style.top =
>(topMargin(buttonElement.cells[0]) ) + "px";
>	// compute "buttonElement.offsetWidth" (for TR) by
>summing all TD offsetWidths
>	var rowWidth = 0;
>	for ( var i = 0; i < buttonElement.cells.length; ++i
>) {
>		rowWidth += buttonElement.cells[i].offsetWidth;
>	}
>	submenuElement.style.left =
>(leftMargin(buttonElement) + rowWidth - 9) + "px";
>	addClass( submenuElement, "menuDropDivVisible" );
>	currentSubmenu = submenuElement;
>}
>
>My exact version of Safari is 1.2.4 (v125.12).
>
>Thanks,
>David Findley
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Metamorphosis-sandbox mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/metamorphosis-sandbox
>
>
>  
>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click