Author: Alex.Kolonitsky
Date: 2009-08-24 13:02:49 -0400 (Mon, 24 Aug 2009)
New Revision: 15285
Modified:
tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
RF-7172 fix
Modified:
tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
===================================================================
---
tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2009-08-24
17:02:17 UTC (rev 15284)
+++
tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2009-08-24
17:02:49 UTC (rev 15285)
@@ -46,7 +46,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<UIContextMenu> getComponentClass() {
return UIContextMenu.class;
}
@@ -66,18 +66,11 @@
styleClass = "";
}
- writeAttr(writer, HTML.onmousemove_ATTRIBUTE,
layer.getAttributes().get("onmousemove"));
- writeAttr(writer, HTML.onmouseout_ATTRIBUTE,
layer.getAttributes().get("onmouseout"));
- writeAttr(writer, HTML.onmouseover_ATTRIBUTE,
layer.getAttributes().get("onmouseover"));
-
+ getUtils().writeAttribute(writer, HTML.onmousemove_ATTRIBUTE,
layer.getAttributes().get("onmousemove"));
+ getUtils().writeAttribute(writer, HTML.onmouseout_ATTRIBUTE,
layer.getAttributes().get("onmouseout"));
+ getUtils().writeAttribute(writer, HTML.onmouseover_ATTRIBUTE,
layer.getAttributes().get("onmouseover"));
+
writer.writeAttribute(HTML.class_ATTRIBUTE, "rich-menu-list-border " +
styleClass, null);
writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " +
style, null);
}
-
- private void writeAttr(ResponseWriter writer, final String name, final Object value)
throws IOException {
- if (value != null) {
- writer.writeAttribute(name, value, null);
- }
-
- }
}
Modified:
tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
---
tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2009-08-24
17:02:17 UTC (rev 15284)
+++
tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2009-08-24
17:02:49 UTC (rev 15285)
@@ -109,11 +109,21 @@
this.element.appendChild(div);
var html = this.evaluator.invoke('getContent', context||{}).join('');
+ html = this.interpolate(html, context);
new Insertion.Top(div, html);
this.menuContent = div;
},
+ interpolate: function (placeholders, context) {
+ for(var k in context) {
+ var v = context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ },
+
destroyMenu: function() {
if (this.menuContent) {
window.RichFaces.Memory.clean(this.menuContent);
Show replies by date