Bug 46001

Summary: Menubar doesn't work if page contains an iframe
Product: Lenya Reporter: Andreas Hartmann <andreas>
Component: MiscellaneousAssignee: Lenya Developers <dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: Trunk   
Target Milestone: 2.0.1   
Hardware: All   
OS: All   

Description Andreas Hartmann 2008-10-14 01:57:30 UTC
The menubar doesn't work if the page contains an iframe.

Reason:
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:variable>
               <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>
             </head>
-            <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()"/>
               </div>
-              <script type="text/javascript"> initialize(); </script>
             </body>
           </html>
         </xso:template>