Author: sergeyhalipov
Date: 2008-01-16 06:57:13 -0500 (Wed, 16 Jan 2008)
New Revision: 5407
Modified:
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
http://jira.jboss.com/jira/browse/RF-1456
Modified:
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java
===================================================================
---
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java 2008-01-16
11:37:45 UTC (rev 5406)
+++
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java 2008-01-16
11:57:13 UTC (rev 5407)
@@ -42,4 +42,7 @@
public abstract void setDisableDefaultMenu(boolean b);
+ public abstract void setShowDelay(Integer showDelay);
+ public abstract Integer getShowDelay();
+
}
Modified:
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
===================================================================
---
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-01-16
11:37:45 UTC (rev 5406)
+++
branches/3.1.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-01-16
11:57:13 UTC (rev 5407)
@@ -110,7 +110,8 @@
writer.startElement("script", component);
writer.writeText("new Richfaces.ContextMenu('", null);
writer.writeText(component.getClientId(context), null);
- writer.writeText("',", null);
+ writer.writeText("', ", null);
+ writer.writeText(menu.getShowDelay() + ", ", null);
writeScriptBody(context, component, true);
writer.writeText(")", null);
writer.writeText(getClientAttachmentOptions(context, menu), null);
Modified:
branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
---
branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2008-01-16
11:37:45 UTC (rev 5406)
+++
branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2008-01-16
11:57:13 UTC (rev 5407)
@@ -3,13 +3,14 @@
Richfaces.ContextMenu.prototype = {
- initialize: function(id, evaluator, options) {
+ initialize: function(id, delay, evaluator, options) {
this.options = options || {};
this.id = id;
this.evaluator = evaluator;
$(id).component = this;
this.doShow = this.show;
this.doHide = this.hide;
+ this.delay = delay;
},
attachToParent : function(id, event, context) {
@@ -40,8 +41,8 @@
show: function(event, context) {
this.construct(context);
event.parameters = context;
- new RichFaces.Menu.DelayedContextMenu(this.id + "_menu", event).show();
- //Event.stop(event||window.event);
+ var delayedMenu = new RichFaces.Menu.DelayedContextMenu(this.id + "_menu",
event);
+ window.setTimeout(delayedMenu.show, this.delay);
},
construct: function(context) {