[richfaces-svn-commits] JBoss Rich Faces SVN: r615 - in trunk/richfaces: dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css and 4 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed May 2 17:20:54 EDT 2007


Author: nbelaevski
Date: 2007-05-02 17:20:54 -0400 (Wed, 02 May 2007)
New Revision: 615

Modified:
   trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
   trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss
   trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
   trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
   trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
   trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
Log:
RF-137, 138 fixed

Modified: trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java	2007-05-02 15:51:14 UTC (rev 614)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java	2007-05-02 21:20:54 UTC (rev 615)
@@ -39,6 +39,7 @@
 import org.richfaces.component.UIMenuGroup;
 import org.richfaces.component.UIMenuItem;
 import org.richfaces.component.UIMenuSeparator;
+import org.richfaces.component.util.HtmlUtil;
 import org.richfaces.renderkit.ScriptOptions;
 import org.ajax4jsf.framework.util.javascript.JSFunction;
 
@@ -73,12 +74,28 @@
 		writer.startElement("div", layer);
 		writer.writeAttribute("id", clientId+"_menu", null);
 		writer.writeAttribute("class", "dr-menu-list-border rich-menu-list-border", null);
-		writer.writeAttribute("style", "visibility: hidden; z-index:100; " + (width!=null&&width.length()>0?"width: "+width:""), null);
+		writer.writeAttribute("style", "visibility: hidden; z-index:100; ", null);
 		writer.startElement("div", layer);
 		writer.writeAttribute("class", "dr-menu-list-bg rich-menu-list-bg", null);
 		encodeItems(context, layer);
+
+		writer.startElement("div", layer);
+		writer.writeAttribute("class", "dr-menu-list-strut rich-menu-list-strut", null);
+		
+		writer.startElement("img", layer);
+		writer.writeAttribute("width", "1", null);
+		writer.writeAttribute("height", "1", null);
+		writer.writeAttribute("alt", "", null);
+		writer.writeAttribute("border", "0", null);
+		writer.writeAttribute("style", width!=null && width.length() > 0 ? "width: " + HtmlUtil.qualifySize(width) : "", null);
+		writer.writeAttribute("src", 
+				getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context, null), 
+				null);
+		writer.endElement("img");
 		writer.endElement("div");
+		
 		writer.endElement("div");
+		writer.endElement("div");
 
 		writer.startElement("iframe", layer);
 		writer.writeAttribute("id", clientId+"_menu_iframe", null);
@@ -120,8 +137,6 @@
 	}
 
 	public void encodeScript(FacesContext context, UIComponent component) throws IOException {
-		
-		
 		StringBuffer buffer = new StringBuffer();
 		JSFunction function = new JSFunction("new Exadel.Menu.Layer");
 		function.addParameter(component.getClientId(context)+"_menu");

Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss	2007-05-02 15:51:14 UTC (rev 614)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/css/dropdownmenu.xcss	2007-05-02 21:20:54 UTC (rev 615)
@@ -37,6 +37,13 @@
 .dr-label-text-decor { 
 	font-weight : bold;
 }
+
+.dr-menu-list-strut {
+	font-size : 0px; 
+	border: 0px; 
+	margin : 0px;
+}
+
 .underneath_iframe{
 	position: absolute;
 	z-index: 90;
@@ -72,8 +79,8 @@
 
 <u:selector name=".dr-menu-label-select">
 	<u:style name="border-color" skin="panelBorderColor" />
-	<u:style name="background-color" skin="headerBackgroundColor" />
-	<u:style name="color" skin="headerTextColor" />
+	<u:style name="background-color" skin="controlBackgroundColor" />
+	<u:style name="color" skin="generalTextColor" />
 </u:selector>
 
 </f:template>

Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js	2007-05-02 15:51:14 UTC (rev 614)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js	2007-05-02 21:20:54 UTC (rev 615)
@@ -224,7 +224,8 @@
 	},
 	showMenuLayer: function (layerId, e, delay){
 		this.clearPopUpTO();
-		this.showTimeOutFlag = setTimeout(new Exadel.Menu.DelayedPopUp(layerId, e).show, delay);
+		this.showTimeOutFlag = setTimeout(new Exadel.Menu.DelayedPopUp(layerId, e, function(){this.layerId = null;}.bind(this)).show, delay);
+		this.layerId = layerId;
 	},
 	showDropDownLayer: function (layerId, parentId, e, delay){
 		this.clearPopUpTO();
@@ -661,6 +662,10 @@
 	       function(e){
 	             Exadel.Menu.MouseIn=true;
 		         Exadel.Menu.Layers.clearLMTO();
+		         
+		         var menuNode = this.layer.parentNode;
+		         $(menuNode.id + 'Label').className='dr-menu-label dr-menu-label-select rich-ddmenu-label rich-ddmenu-label-select';
+				
 		         Event.stop(e);
 	       }.bindAsEventListener(this);
 	
@@ -670,6 +675,9 @@
 		          if (!Exadel.Menu.selectOpen) {
 			         Exadel.Menu.Layers.setLMTO(this.hideDelay);
 		          }
+			         var menuNode = this.layer.parentNode;
+			         $(menuNode.id + 'Label').className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect';
+				
 		          Event.stop(e);
 	         }.bindAsEventListener(this);
 
@@ -806,7 +814,6 @@
    		Exadel.Menu.Layers.showMenuLayer(this.id, e, this.delay);
    		Exadel.Menu.Layers.levels[this.level] = this;
 //		if (this.eventOnOpen) this.eventOnOpen();
-
 	},
 	closeSiblings: function(e){
 		//LOG.a4j_debug('closeASiblins ' + this.id +' ' +this.level);

Modified: trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx	2007-05-02 15:51:14 UTC (rev 614)
+++ trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx	2007-05-02 21:20:54 UTC (rev 615)
@@ -21,25 +21,29 @@
     <jsp:scriptlet>
 		<![CDATA[org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(context,component);]]>		                                               
     </jsp:scriptlet>	
-    <div id="#{clientId}" class="dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect #{component.attributes['styleClass']}"
-         style="#{component.attributes['style']};" 
-         onmouseover="this.className='dr-menu-label dr-menu-label-select rich-ddmenu-label rich-ddmenu-label-select' ; #{component.attributes['onmouseover']}" 
-         onmouseout="this.className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect'; #{component.attributes['onmouseout']}"         
+    <div id="#{clientId}" class="#{component.attributes['styleClass']}"
+         style="position: relative; #{component.attributes['style']};" 
+	     onmouseover="$('#{clientId}Label').className='dr-menu-label dr-menu-label-select rich-ddmenu-label rich-ddmenu-label-select' ; #{component.attributes['onmouseover']}" 
+       	 onmouseout="$('#{clientId}Label').className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect'; #{component.attributes['onmouseout']}"         
          onmousemove="#{component.attributes['onmousemove']}">
-		 <jsp:scriptlet>
-					<![CDATA[if(component.getFacet("label")!=null && component.getFacet("label").isRendered()) {]]>
-		 </jsp:scriptlet>
-		    <span class="dr-label-text-decor rich-label-text-decor">
-			           <u:insertFacet name="label" />
-			</span>
-		<jsp:scriptlet>	
-					<![CDATA[} else {]]> 
-		</jsp:scriptlet>         
-            <span class="dr-label-text-decor rich-label-text-decor">#{component.attributes['value']}</span>             
-		<jsp:scriptlet>	
-					<![CDATA[}]]> 
-		</jsp:scriptlet>         
 
+		<div id="#{clientId}Label" class="dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect"
+		>
+			 <jsp:scriptlet>
+						<![CDATA[if(component.getFacet("label")!=null && component.getFacet("label").isRendered()) {]]>
+			 </jsp:scriptlet>
+			    <span class="dr-label-text-decor rich-label-text-decor">
+				           <u:insertFacet name="label" />
+				</span>
+			<jsp:scriptlet>	
+						<![CDATA[} else {]]> 
+			</jsp:scriptlet>         
+	            <span class="dr-label-text-decor rich-label-text-decor">#{component.attributes['value']}</span>             
+			<jsp:scriptlet>	
+						<![CDATA[}]]> 
+			</jsp:scriptlet>         
+		</div>
+
 		<vcp:body>
 			<f:call name="renderChildren" />
 		</vcp:body>

Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java	2007-05-02 15:51:14 UTC (rev 614)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/images/MenuNodeImage.java	2007-05-02 21:20:54 UTC (rev 615)
@@ -41,7 +41,7 @@
         String tmp;
         int intValue;
         
-        tmp = (String) skin.getParameter(context,"headerBackgroundColor");
+        tmp = (String) skin.getParameter(context,"generalTextColor");
         if (tmp == null) tmp = "#4A75B5";
         intValue = HtmlColor.decode(tmp).getRGB();
         mnd.setGeneralColor(new Integer(intValue));

Modified: trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
===================================================================
--- trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss	2007-05-02 15:51:14 UTC (rev 614)
+++ trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss	2007-05-02 21:20:54 UTC (rev 615)
@@ -68,13 +68,10 @@
 </u:selector>
 
 <u:selector name=".dr-menu-item-hover">
-	<u:style name="background-image">
-		<f:resource f:key="org.richfaces.renderkit.html.images.background.MenuItemBackground"/>
-	</u:style>
 	<u:style name="background-position" value="top left"/>
 	<u:style name="background-repeat" value="repeat-x"/>
-	<u:style name="border-color" skin="headerBackgroundColor" />
-	<u:style name="background-color" skin="tabBackgroundColor" />
+	<u:style name="border-color" skin="tipBorderColor" />
+	<u:style name="background-color" skin="tipBackgroundColor" />
 </u:selector>
 
 <u:selector name=".dr-menu-node">




More information about the richfaces-svn-commits mailing list