Author: akushunin
Date: 2008-01-24 10:41:45 -0500 (Thu, 24 Jan 2008)
New Revision: 5592
Modified:
branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-1993
Modified:
branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
---
branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-24
15:08:33 UTC (rev 5591)
+++
branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-24
15:41:45 UTC (rev 5592)
@@ -164,14 +164,6 @@
writer.endElement("div");
writer.endElement("div");
- writer.startElement("iframe", layer);
- writer.writeAttribute("src","javascript:''", null);
- writer.writeAttribute("id", clientId+"_menu_iframe", null);
- writer.writeAttribute("class", "underneath_iframe", null);
- writer.writeAttribute("style", "position:absolute; z-index: 1;",
null);
- writer.writeText("aaa", null);
- writer.endElement("iframe");
-
writer.startElement("script", layer);
writer.writeAttribute("id", clientId+"_menu_script", null);
writer.writeAttribute("type", "text/javascript", null);
@@ -180,7 +172,6 @@
AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
Set renderedAreas = ajaxContext.getAjaxRenderedAreas();
- renderedAreas.add(clientId + "_menu_iframe");
renderedAreas.add(clientId + "_menu_script");
}
Modified:
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-24
15:08:33 UTC (rev 5591)
+++
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-24
15:41:45 UTC (rev 5592)
@@ -140,12 +140,22 @@
}
},
+ initIFrame: function(layer) {
+ var menu = $(layer);
+ var iframe = new Insertion.Before(menu,
+ "<iframe src=\"javascript:''\" id=\"" + menu.id +
"_iframe\" style=\" position: absolute; z-index: 1;\"
class=\"underneath_iframe\">" + "</iframe>");
+ return iframe;
+ },
+
ieSelectWorkAround: function(menuName, on){
//alert(navigator.userAgent);
if(this.IE || this.NS) {
menuName = $(menuName).id;
var menu = $(menuName);
var iframe = $(menuName + "_iframe");
+ if(!iframe&&on){
+ iframe = this.initIFrame(menu);
+ }
var nsfix = (this.NS ? 7 : 0);
if(on){
var dim = Element.getDimensions(menu);
@@ -154,7 +164,7 @@
iframe.style.width = menu.offsetWidth + "px"
iframe.style.height = menu.offsetHeight + "px"
iframe.style.visibility = "visible";
- } else {
+ } else if(iframe) {
iframe.style.visibility = "hidden";
}
}