Author: akushunin
Date: 2008-01-23 12:07:24 -0500 (Wed, 23 Jan 2008)
New Revision: 5571
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-1993
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
---
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-23
16:00:44 UTC (rev 5570)
+++
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-23
17:07:24 UTC (rev 5571)
@@ -165,13 +165,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.endElement("iframe");
-
writer.startElement("script", layer);
writer.writeAttribute("id", clientId+"_menu_script", null);
writer.writeAttribute("type", "text/javascript", null);
Modified:
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-23
16:00:44 UTC (rev 5570)
+++
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-23
17:07:24 UTC (rev 5571)
@@ -67,6 +67,7 @@
showTimeoutLength: 0,
queuedId : '',
+
LMPopUp:function(menuName, isCurrent) {
if (!this.loaded || ( this.isVisible(menuName) && !isCurrent)) {
return;
@@ -139,13 +140,23 @@
}
}
},
+
+ initIFrame: function(layer) {
+ var menu = $(layer);
+ new Insertion.Before(menu,
+ "<iframe src=\"javascript:''\" id=\"" + menu.id +
"_iframe\" style=\" position: absolute; z-index: 1;\"
class=\"underneath_iframe\">" + "</iframe>");
+ },
ieSelectWorkAround: function(menuName, on){
//alert(navigator.userAgent);
if(this.IE || this.NS) {
menuName = $(menuName).id;
var menu = $(menuName);
- var iframe = $(menuName + "_iframe");
+ var iframe = $(menuName + "_iframe");
+ if(!iframe&&on){
+ this.initIFrame(menu);
+ iframe = $(menuName + "_iframe");
+ }
var nsfix = (this.NS ? 7 : 0);
if(on){
var dim = Element.getDimensions(menu);
@@ -154,10 +165,11 @@
iframe.style.width = menu.offsetWidth + "px"
iframe.style.height = menu.offsetHeight + "px"
iframe.style.visibility = "visible";
- } else {
+ } else if(iframe) {
iframe.style.visibility = "hidden";
- }
+ }
}
+
},
shutdown: function () {
@@ -238,6 +250,7 @@
clearPopUpTO: function(){
clearTimeout(this.showTimeOutFlag);
+ this.iframe=null;
},
showMenuLayer: function (layerId, e, delay){
this.clearPopUpTO();
@@ -397,7 +410,7 @@
this.layer.style.left = layerLeft + "px";
this.layer.style.top = layerTop + "px";
-
+
RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
RichFaces.Menu.Layers.clearLMTO();
}.bind(this);
@@ -550,7 +563,7 @@
this.layer.style.top = layerPos.top + vOffset - deltaY - this.top + "px";
this.layer.style.width = this.layer.clientWidth + "px";
-
+
RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
RichFaces.Menu.Layers.clearLMTO();
}.bind(this);