Author: pyaschenko
Date: 2008-04-21 11:32:14 -0400 (Mon, 21 Apr 2008)
New Revision: 8019
Modified:
trunk/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
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-3112
Modified:
trunk/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
---
trunk/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2008-04-21
15:09:24 UTC (rev 8018)
+++
trunk/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2008-04-21
15:32:14 UTC (rev 8019)
@@ -76,6 +76,7 @@
var div = document.createElement("div");
div.id = this.id + ":_auto_created";
+ div.style.zoom="1";
this.element.appendChild(div);
var html = this.evaluator.invoke('getContent',
context||window).join('');
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-04-21
15:09:24 UTC (rev 8018)
+++
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-04-21
15:32:14 UTC (rev 8019)
@@ -157,7 +157,7 @@
writer.startElement(HTML.DIV_ELEM, layer);
writer.writeAttribute(HTML.id_ATTRIBUTE, clientId+"_menu", null);
writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border
rich-menu-list-border " + styleClass, null);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "visibility: hidden; z-index: 2;
" + style, null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " +
style, null);
writer.startElement(HTML.DIV_ELEM, layer);
writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-bg
rich-menu-list-bg", null);
encodeItems(context, layer);
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-04-21
15:09:24 UTC (rev 8018)
+++
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-04-21
15:32:14 UTC (rev 8019)
@@ -88,7 +88,7 @@
},
isVisible: function(layer) {
- return ($(layer).style.visibility == 'visible');
+ return ($(layer).style.display != 'none');
},
/**
@@ -213,7 +213,7 @@
var tmpLayer = $(layer);
if (visible) {
- tmpLayer.style.visibility = 'visible';
+ tmpLayer.style.display = '';
} else {
if(tmpLayer.getElementsByTagName){
var inputs = tmpLayer.getElementsByTagName('INPUT');
@@ -222,7 +222,7 @@
} // if
} // if
- tmpLayer.style.visibility = 'hidden';
+ tmpLayer.style.display = 'none';
// tmpLayer.style.left = "-"+tmpLayer.clientWidth;
// Element.hide(tmpLayer);
} // else
@@ -354,6 +354,13 @@
var bodyHeight = body.height;
var bodyWidth = body.width;
+ var layer_display = this.layer.style.display;
+ if (layer_display=='none')
+ {
+ this.layer.style.visibility='hidden';
+ this.layer.style.display='';
+ }
+
var clientX = this.event.clientX;
var clientY = this.event.clientY;
@@ -409,6 +416,9 @@
this.layer.style.left = layerLeft + "px";
this.layer.style.top = layerTop + "px";
+
+ this.layer.style.display=layer_display;
+ this.layer.style.visibility='';
RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
RichFaces.Menu.Layers.clearLMTO();
@@ -488,6 +498,13 @@
this.show = function() {
RichFaces.Menu.Layers.shutdown();
+
+ var layer_display = this.layer.style.display;
+ if (layer_display=='none')
+ {
+ this.layer.style.visibility='hidden';
+ this.layer.style.display='';
+ }
var winOffset = RichFaces.Menu.getWindowScrollOffset();
var win = RichFaces.Menu.getWindowDimensions();
@@ -562,6 +579,9 @@
this.layer.style.top = layerPos.top + vOffset - deltaY - this.top + "px";
this.layer.style.width = this.layer.clientWidth + "px";
+
+ this.layer.style.display=layer_display;
+ this.layer.style.visibility='';
RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
RichFaces.Menu.Layers.clearLMTO();
@@ -583,7 +603,19 @@
this.show = function() {
if (!RichFaces.Menu.Layers.isVisible(this.layer) &&
RichFaces.Menu.Layers.isVisible(RichFaces.Menu.Layers.father[this.layer.id])) {
+
+ var layer_display = this.layer.style.display;
+ if (layer_display=='none')
+ {
+ this.layer.style.visibility='hidden';
+ this.layer.style.display='';
+ }
+
this.reposition();
+
+ this.layer.style.display=layer_display;
+ this.layer.style.visibility='';
+
RichFaces.Menu.Layers.LMPopUp(this.layer, false);
}
}.bind(this);