Author: abelevich
Date: 2011-01-21 08:28:40 -0500 (Fri, 21 Jan 2011)
New Revision: 21147
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
trunk/ui/output/ui/src/main/templates/menuitem.template.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10219 dropDownMenu: need to make visual and behavior
corrections. appearance and custor.
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2011-01-21
13:01:41 UTC (rev 21146)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2011-01-21
13:28:40 UTC (rev 21147)
@@ -37,7 +37,8 @@
public static final String RENDERER_TYPE =
"org.richfaces.DropDownMenuRenderer";
- public static final int DEFAULT_MIN_POPUP_WIDTH = 250;
+ public static final int DEFAULT_MIN_POPUP_WIDTH = 250;
+ public static final String DEFAULT_SHOWEVENT = "mouseover";
@Override
public void renderChildren(FacesContext facesContext, UIComponent component) throws
IOException {
@@ -156,7 +157,7 @@
protected String getShowEvent(UIComponent component) {
String value = ((AbstractDropDownMenu) component).getShowEvent();
if (value == null || "".equals(value)) {
- value = "click";
+ value = DEFAULT_SHOWEVENT;
}
return value;
}
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-01-21
13:01:41 UTC (rev 21146)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-01-21
13:28:40 UTC (rev 21147)
@@ -20,6 +20,7 @@
}
.rf-ddm-lbl-dec {
font-weight:bold;
+ cursor : pointer;
}
.rf-ddm-lst {
border:1px solid; /*#bfbfc0*/ /*panelBorderColor*/
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-21
13:01:41 UTC (rev 21146)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-21
13:28:40 UTC (rev 21147)
@@ -8,7 +8,7 @@
hideDelay : 300,
verticalOffset : 0,
horisantalOffset : 0,
- showEvent : 'click',
+ showEvent : 'mouseover',
positionOffset : [0, 0],
direction : "AA",
jointPoint : "AA",
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-21
13:01:41 UTC (rev 21146)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-21
13:28:40 UTC (rev 21147)
@@ -1,10 +1,15 @@
(function($, rf) {
rf.ui = rf.ui || {};
+
+ var defaultOptions = {
+ mode : "server"
+ }
// constructor definition
rf.ui.MenuItem = function(componentId, options) {
- this.options = options;
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
$super.constructor.call(this, componentId);
this.attachToDom(componentId);
this.element = $(rf.getDomElement(componentId));
Modified: trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-21 13:01:41
UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-21 13:28:40
UTC (rev 21147)
@@ -52,9 +52,12 @@
<cdk:scriptObject name="options">
<cdk:scriptOption name="direction"
value="#{getDirection(component).getValue()}"
defaultValue="org.richfaces.component.Positioning.DEFAULT.getValue()"/>
<cdk:scriptOption name="jointPoint"
value="#{getJointPoint(component).getValue()}"
defaultValue="org.richfaces.component.Positioning.DEFAULT.getValue()"/>
- <cdk:scriptOption name="showEvent"
value="#{getShowEvent(component)}"
defaultValue='"click"'/>
+ <cdk:scriptOption name="showEvent"
value="#{getShowEvent(component)}"
defaultValue='this.DEFAULT_SHOWEVENT'/>
<cdk:scriptOption name="mode"
value="#{getMode(component)}"
defaultValue="org.richfaces.component.Mode.server"/>
- <cdk:scriptOption attributes="hideDelay showEvent showDelay
horizontalOffset verticalOffset" />
+ <cdk:scriptOption name="horizontalOffset"
value="#{component.attributes['horizontalOffset']}"
defaultValue='0'/>
+ <cdk:scriptOption name="verticalOffset"
value="#{component.attributes['verticalOffset']}"
defaultValue='0'/>
+ <cdk:scriptOption name="hideDelay"
value="#{component.attributes['hideDelay']}"
defaultValue='300'/>
+ <cdk:scriptOption name="showDelay"
value="#{component.attributes['showDelay']}"
defaultValue='50'/>
<cdk:scriptOption attributes="onshow onhide ongroupshow
ongrouphide onitemclick" wrapper="eventHandler"/>
</cdk:scriptObject>
Modified: trunk/ui/output/ui/src/main/templates/menuitem.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-21 13:01:41 UTC
(rev 21146)
+++ trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-21 13:28:40 UTC
(rev 21147)
@@ -80,7 +80,7 @@
<c:when test="#{not isDisabled}">
<script type="text/javascript">
<cdk:scriptObject name="options">
- <cdk:scriptOption name="mode"
value="#{getSubmitMode(component)}" />
+ <cdk:scriptOption name="mode"
value="#{getSubmitMode(component)}"
defaultValue="org.richfaces.component.Mode.server"/>
<cdk:scriptOption name="submitFunction"
value="#{getOnClickFunction(facesContext, component)}"
wrapper="eventHandler"/>
</cdk:scriptObject>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2011-01-21
13:01:41 UTC (rev 21146)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2011-01-21
13:28:40 UTC (rev 21147)
@@ -8,7 +8,7 @@
</span>
<script type="text/javascript">
//<![CDATA[
- new
RichFaces.ui.MenuItem("form:menuItem",{"submitFunction":function(event){RichFaces.ajax("form:menuItem",event,{"incId":"1"}
);return false;}} );
+ new
RichFaces.ui.MenuItem("form:menuItem",{"mode":"ajax","submitFunction":function(event){RichFaces.ajax("form:menuItem",event,{"incId":"1"}
);return false;}} );
//]]>
</script>
</div>