Bug 46001 - Menubar doesn't work if page contains an iframe
Summary: Menubar doesn't work if page contains an iframe
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: Trunk
Hardware: All All
: P2 normal
Target Milestone: 2.0.1
Assignee: Lenya Developers
Depends on:
Reported: 2008-10-14 01:57 UTC by Andreas Hartmann
Modified: 2008-10-14 01:57 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Hartmann 2008-10-14 01:57:30 UTC
The menubar doesn't work if the page contains an iframe.

The menu.js tries to assign the event handlers before the DOM construction is finished, therefore the menu objects (id=nav*) are null.

If the initialize() function is called in the body/@onload attribute, it works:

Index: src/modules/menubar/xslt/menu2xslt.xsl
--- src/modules/menubar/xslt/menu2xslt.xsl	(Revision ...)
+++ src/modules/menubar/xslt/menu2xslt.xsl	(working copy)
@@ -59,14 +59,14 @@
               <xso:comment>[if IE 6]<![CDATA[>]]>&lt;link rel="stylesheet" type="text/css" href="<xso:value-of select="$contextprefix"/>/lenya/css/ie6hacksonly.css" /><![CDATA[<![endif]]]></xso:comment>
-            <body>
+            <body onload="initialize();">
               <xso:apply-templates select="xhtml:html/xhtml:body/@*"/>
               <xsl:apply-templates select="xhtml:div/xhtml:div[@id = 'lenya-logo']"/>
               <xsl:apply-templates select="xhtml:div/xhtml:div[@id = 'lenya-menus']"/>
               <div id="lenya-cmsbody">
                 <xso:apply-templates select="xhtml:html/xhtml:body/node()"/>
-              <script type="text/javascript"> initialize(); </script>