[richfaces-svn-commits] JBoss Rich Faces SVN: r5332 - in trunk/sandbox/ui/combobox/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Sat Jan 12 11:27:49 EST 2008


Author: abelevich
Date: 2008-01-12 11:27:49 -0500 (Sat, 12 Jan 2008)
New Revision: 5332

Modified:
   trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
   trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
   trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
fix hover classes behavior 

Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss	2008-01-12 15:32:58 UTC (rev 5331)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss	2008-01-12 16:27:49 UTC (rev 5332)
@@ -141,12 +141,6 @@
 }
 
 .rich-combobox-button-hovered {
-	position : absolute; 
-	top : 0px; 
-	right : 0px; //left: fullWidth - 17px; 
-	width : 17px; 
-	margin : 0px; 
-	border : 1px solid; 
 }
 
 .rich-combobox-button-background { 

Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-12 15:32:58 UTC (rev 5331)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-12 16:27:49 UTC (rev 5332)
@@ -45,7 +45,8 @@
 		this.field.observe("focus", function(e){this.fieldHandler(e);}.bindAsEventListener(this));
 		this.comboList.listParent.observe("mousedown", function(e){this.listMousedownHandler(e);}.bindAsEventListener(this));
 		this.button.observe("mousedown", function(e){this.buttonMousedownHandler(e);}.bindAsEventListener(this));
-		
+		this.button.observe("mouseover", function(e){this.buttonMouseOverHandler(e);}.bindAsEventListener(this));
+		this.button.observe("mouseout", function(e){this.buttonMouseOutHandler(e);}.bindAsEventListener(this));
 		this.field.observe("keyup", function(e){this.dataUpdating(e);}.bindAsEventListener(this));
 		
 		this.comboList.listParent.observe("mousemove", function(e){this.listListener(e)}.bindAsEventListener(this));
@@ -105,6 +106,24 @@
 		this.comboList.isList = true;
 	},
 	
+	buttonMouseOverHandler : function(e) {
+		var classCss = this.classes.BUTTON.CLASSES;
+		if (this.isActive()) { 
+			this.button.className= classCss.ACTIVE + " " + classCss.HOVERED;
+		} else {
+			this.button.className = classCss.NORMAL + " " + classCss.HOVERED;
+		}	
+	},
+	
+	buttonMouseOutHandler : function(e) {
+		if (this.isActive()) { 
+			this.button.className= this.classes.BUTTON.CLASSES.ACTIVE;
+		} else {
+			this.button.className = this.classes.BUTTON.CLASSES.NORMAL;
+		}	
+	},
+	
+	
 	fieldHandler : function() {
 		this.doActive();
 		if (this.field.value == this.defaultMessage) {
@@ -227,11 +246,16 @@
 			}
 		}
 	},
+	isActive : function() {
+		return (this.field.className == this.classes.FIELD.ACTIVE); 
+		
+	},
 	
 	doActive : function() {
 		this.button.className = this.classes.BUTTON.CLASSES.ACTIVE;
  		this.field.className = this.classes.FIELD.CLASSES.ACTIVE;
  		this.buttonBG.className = this.classes.BUTTONBG.CLASSES.ACTIVE;
+ 		this.isDisabled = false;
 	},
 	
 	doDisable : function() {
@@ -241,6 +265,8 @@
 		
 		this.button.disabled = true;
 		this.field.disabled = true;
+		
+		this.isDisabled = true;
 	},
 	
 	doNormal : function() {
@@ -250,6 +276,7 @@
 		
 		this.button.disabled = false;
 		this.field.disabled = false;
+		this.isDisabled = false;
 	}
 };
 

Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-12 15:32:58 UTC (rev 5331)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-12 16:27:49 UTC (rev 5332)
@@ -198,10 +198,9 @@
 			<input id="comboBoxButtonBG#{clientId}" readonly="true" type="text" value="" class="rich-combobox-font rich-combobox-button-background rich-combobox-button"/>
 			<input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}" 
 				   class="rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}" 
-				   onmousedown="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-button-pressed rich-combobox-font rich-combobox-button-icon';"
-				   onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-font rich-combobox-button-icon'"
-				   onmouseout="this.className='rich-combobox-font rich-combobox-button-icon rich-combobox-button'"
-				   onmouseover="this.className='rich-combobox-font rich-combobox-button-icon rich-combobox-button-hovered'"/>
+				   onmousedown="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-button-pressed rich-combobox-font rich-combobox-button-icon rich-combobox-button-hovered';"
+				   onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-font rich-combobox-button-icon rich-combobox-button-hovered'"/>
+						   
 			<input type="text" class="rich-combobox-strut rich-combobox-font" style="width:#{width}"/>
 		</div>
 		
@@ -223,7 +222,8 @@
 			BUTTON : {CLASSES :
 						 {NORMAL : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled  #{buttonDisabledClass}", 
 					  	  ACTIVE : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}", 
-						  DISABLED : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}"},
+						  DISABLED : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}",
+						  HOVERED : "rich-combobox-button-hovered"},
 					  STYLE : 
 					  	 {NORMAL: #{buttonDisabledStyle},
 					  	  ACTIVE: #{buttonStyle},




More information about the richfaces-svn-commits mailing list