Author: sergeyhalipov
Date: 2008-03-31 09:11:19 -0400 (Mon, 31 Mar 2008)
New Revision: 7463
Modified:
trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-2066
Modified: trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml
===================================================================
--- trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml 2008-03-31 13:07:40
UTC (rev 7462)
+++ trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml 2008-03-31 13:11:19
UTC (rev 7463)
@@ -175,6 +175,23 @@
Space-separated list of CSS style class(es) that are be applied to disabled item of
this component
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+ <property>
+ <name>disabledLabelClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Space-separated list of CSS style class(es) that are be applied to disabled label of
DD menu
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>selectedLabelClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Space-separated list of CSS style class(es) that are be applied to selected label of
DD menu
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
Modified:
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
---
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-03-31
13:07:40 UTC (rev 7462)
+++
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-03-31
13:11:19 UTC (rev 7463)
@@ -47,6 +47,10 @@
if (component instanceof UIDropDownMenu) {
function.addParameter(component.getAttributes().get("hideDelay"));
+ Object selectedClass =
component.getAttributes().get("selectedLabelClass");
+ if (null != selectedClass && !"".equals(selectedClass)) {
+ function.addParameter(selectedClass);
+ }
} else {
function.addParameter(new Integer(300));
}
Modified: trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
===================================================================
---
trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2008-03-31
13:07:40 UTC (rev 7462)
+++
trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2008-03-31
13:11:19 UTC (rev 7463)
@@ -18,7 +18,7 @@
if (!menu.isDisabled()) {]]>
</jsp:scriptlet>
<div id="#{clientId}"
style="#{component.attributes['style']}"
- class="#{component.attributes['styleClass']} dr-menu-label
dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect"
+ class="dr-menu-label dr-menu-label-unselect rich-ddmenu-label
rich-ddmenu-label-unselect #{component.attributes['styleClass']}"
onmouseover="#{component.attributes['onmouseover']}"
onmouseout="#{component.attributes['onmouseout']}"
onmousemove="#{component.attributes['onmousemove']}">
@@ -26,7 +26,7 @@
<![CDATA[ } else { ]]>
</jsp:scriptlet>
<div id="#{clientId}"
style="#{component.attributes['style']}"
- class="dr-menu-label dr-menu-label-unselect dr-ddmenu-label-disabled
rich-ddmenu-label-disabled rich-ddmenu-label-unselect
#{component.attributes['styleClass']}"
+ class="dr-menu-label dr-menu-label-unselect dr-ddmenu-label-disabled
rich-ddmenu-label-disabled rich-ddmenu-label-unselect
#{component.attributes['styleClass']}
#{component.attributes['disabledLabelClass']}"
onmouseover="#{component.attributes['onmouseover']}"
onmouseout="#{component.attributes['onmouseout']}"
onmousemove="#{component.attributes['onmousemove']}">
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-03-31
13:07:40 UTC (rev 7462)
+++
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-31
13:11:19 UTC (rev 7463)
@@ -707,7 +707,7 @@
RichFaces.Menu.Layer = Class.create();
RichFaces.Menu.Layer.prototype = {
- initialize: function(id,delay, hideDelay){
+ initialize: function(id,delay, hideDelay, selectedClass){
RichFaces.Menu.Layers.listl.push(id);
this.id = id;
this.layer = $(id);
@@ -819,6 +819,10 @@
var listener = new A4J.AJAX.Listener(this.rebind.bindAsEventListener(this));
A4J.AJAX.AddListener(listener);
} */
+
+ if (selectedClass) {
+ this.selectedClass = selectedClass;
+ }
},
getLabel : function() {
@@ -830,6 +834,9 @@
RichFaces.Menu.Items.replaceClasses(label1,
['dr-menu-label-unselect', 'rich-ddmenu-label-unselect'],
['dr-menu-label-select','rich-ddmenu-label-select']);
+ if (this.selectedClass) {
+ Element.addClassName(label1, this.selectedClass);
+ }
},
unHighlightLabel: function() {
@@ -837,6 +844,9 @@
RichFaces.Menu.Items.replaceClasses(label1,
['dr-menu-label-select','rich-ddmenu-label-select'],
['dr-menu-label-unselect', 'rich-ddmenu-label-unselect']);
+ if (this.selectedClass) {
+ Element.removeClassName(label1, this.selectedClass);
+ }
},
shouldHighlightParent : function() {