Author: abelevich
Date: 2011-03-02 07:49:47 -0500 (Wed, 02 Mar 2011)
New Revision: 22016
Modified:
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
branches/4.0.X/ui/output/ui/src/main/templates/dropdownmenu.template.xml
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10630 dropDownMenu: menu label not highlighted on
hover/menu expansion . Add base hover functionality. Reviewed by Alex Kolonitsky.
Modified:
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
===================================================================
---
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-03-02
12:22:58 UTC (rev 22015)
+++
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-03-02
12:49:47 UTC (rev 22016)
@@ -3,10 +3,22 @@
font-size:11px;
position:relative;
}
-.rf-ddm-lbl-unsel {
- border:0 solid transparent;
+.rf-ddm-unsel {
+ border:1px solid transparent;
padding:3px 6px;
}
+.rf-ddm-sel {
+ background-image:
"url(#{resource['org.richfaces.images:menu_item_bg.gif']})";
+ background-repeat: repeat-x;
+ background-position: bottom left;
+ background-color: '#{richSkin.additionalBackgroundColor}';
+ /*from additionalBackgroundColor (top) to tabBackgroundColor (bottom)
additionalBackgroundColor*/
+ border : 1px solid; /*headerBackgroundColor*/
+ border-color: '#{richSkin.headerBackgroundColor}';
+ cursor:pointer;
+ padding:3px 6px;
+}
+
.rf-ddm-lbl, .rf-ddm-lbl-dis {
height:auto;
padding:2px 5px;
@@ -65,9 +77,9 @@
border-color: '#{richSkin.headerBackgroundColor}';
cursor : pointer;
padding : 1px 36px 2px 2px;
- background-color: '#{richSkin.tabBackgroundColor}';
+ background-color: '#{richSkin.additionalBackgroundColor}';
background-repeat: repeat-x;
- background-position: top;
+ background-position: bottom left;
background-image:
"url(#{resource['org.richfaces.images:menu_item_bg.gif']})";
z-index:10;
}
@@ -89,7 +101,7 @@
}
.rf-ddm-sep {
font-size : 0px;
- border-top: 1px solid; /* #bfbfc0;*/ /*panelBorderColor*/
+ border-top: 1px solid; /* #BED6F8;*/ /*panelBorderColor*/
border-top-color: '#{richSkin.panelBorderColor}';
margin : 2px 0px 2px 24px;
}
Modified:
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
---
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-03-02
12:22:58 UTC (rev 22015)
+++
branches/4.0.X/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-03-02
12:49:47 UTC (rev 22016)
@@ -4,27 +4,29 @@
var defaultOptions = {
positionType : "DROPDOWN",
direction : "AA",
- jointPoint : "AA"
+ jointPoint : "AA",
+ selectMenuCss : "rf-ddm-sel",
+ unselectMenuCss : "rf-ddm-unsel"
};
// constructor definition
- rf.ui.Menu = function(componentId, options) {
- this.options = {};
- $.extend(this.options, defaultOptions, options || {});
- $super.constructor.call(this, componentId, this.options);
- this.id = componentId;
- this.namespace = this.namespace || "."
- + rf.Event.createNamespace(this.name, this.id);
- this.groupList = new Array();
+ rf.ui.Menu = function(componentId, options) {
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
+ $super.constructor.call(this, componentId, this.options);
+ this.id = componentId;
+ this.namespace = this.namespace || "."
+ + rf.Event.createNamespace(this.name, this.id);
+ this.groupList = new Array();
- rf.Event.bindById(this.id + "_label", this.options.showEvent, $.proxy(
- this.__showHandler, this), this);
+ rf.Event.bindById(this.id + "_label", this.options.showEvent, $.proxy(
+ this.__showHandler, this), this);
+ this.element = $(rf.getDomElement(this.id));
- this.attachToDom(componentId);
- if (!rf.ui.MenuManager)
- rf.ui.MenuManager = {};
- this.menuManager = rf.ui.MenuManager;
- };
+ if (!rf.ui.MenuManager)
+ rf.ui.MenuManager = {};
+ this.menuManager = rf.ui.MenuManager;
+ };
rf.ui.MenuBase.extend(rf.ui.Menu);
@@ -67,13 +69,32 @@
this.menuManager.deletedMenuId();
},
- destroy : function() {
- // clean up code here
- this.detach(this.id);
+ select : function() {
+ this.element.removeClass(this.options.unselectMenuCss);
+ this.element.addClass(this.options.selectMenuCss);
+ },
+ unselect : function() {
+ this.element.removeClass(this.options.selectMenuCss);
+ this.element.addClass(this.options.unselectMenuCss);
+ },
- rf.Event.unbindById(this.id + "_label", this.options.showEvent);
+ __overHandler : function() {
+ $super.__overHandler.call(this);
+ this.select();
+ },
- // call parent's destroy method
+ __leaveHandler : function() {
+ $super.__leaveHandler.call(this);
+ this.unselect();
+ },
+
+ destroy : function() {
+ // clean up code here
+ this.detach(this.id);
+
+ rf.Event.unbindById(this.id + "_label",
this.options.showEvent);
+
+ // call parent's destroy method
$super.destroy.call(this);
}
@@ -107,6 +128,5 @@
getActiveSubMenu : function() {
return this.activeSubMenu;
}
-
}
})(jQuery, RichFaces);
\ No newline at end of file
Modified: branches/4.0.X/ui/output/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- branches/4.0.X/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-03-02
12:22:58 UTC (rev 22015)
+++ branches/4.0.X/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-03-02
12:49:47 UTC (rev 22016)
@@ -21,7 +21,7 @@
<cdk:object name="label" value="#{getLabelFacet(facesContext,
component)}" type="javax.faces.component.UIComponent" />
<cdk:object name="isDisabled" type="boolean"
value="#{isDisabled(facesContext, component)}" />
- <div id="#{clientId}" class="rf-ddm-lbl #{isDisabled ?
'rf-ddm-dis' : 'rf-ddm-lbl-unsel '+styleClass} "
style="#{style}"
+ <div id="#{clientId}" class="rf-ddm-lbl #{isDisabled ?
'rf-ddm-dis' : 'rf-ddm-unsel '+styleClass} "
style="#{style}"
cdk:passThroughWithExclusions="">
<div id="#{clientId}_label" class="#{isDisabled ?
'rf-ddm-lbl-dis' : 'rf-ddm-lbl-dec'}">
Modified:
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2011-03-02
12:22:58 UTC (rev 22015)
+++
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2011-03-02
12:49:47 UTC (rev 22016)
@@ -1,4 +1,4 @@
- <div class="rf-ddm-lbl rf-ddm-lbl-unsel "
id="form:ddmenu">
+ <div class="rf-ddm-lbl rf-ddm-unsel " id="form:ddmenu">
<div id="form:ddmenu_label" class="rf-ddm-lbl-dec">
<img src="/images/ddmenu/copy.gif" class="pic"/>
File
Modified:
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2011-03-02
12:22:58 UTC (rev 22015)
+++
branches/4.0.X/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2011-03-02
12:49:47 UTC (rev 22016)
@@ -1,4 +1,4 @@
- <div class="rf-ddm-lbl rf-ddm-lbl-unsel "
id="form:ddmenu">
+ <div class="rf-ddm-lbl rf-ddm-unsel " id="form:ddmenu">
<div id="form:ddmenu_label" class="rf-ddm-lbl-dec">
<img src="/images/ddmenu/copy.gif" class="pic"/>
File