[richfaces-svn-commits] JBoss Rich Faces SVN: r5813 - 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
Tue Feb 5 07:38:47 EST 2008


Author: vmolotkov
Date: 2008-02-05 07:38:47 -0500 (Tue, 05 Feb 2008)
New Revision: 5813

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:
horizontal scrolling is deleted

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-02-05 11:40:45 UTC (rev 5812)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss	2008-02-05 12:38:47 UTC (rev 5813)
@@ -67,7 +67,7 @@
 
 .rich-combobox-list-scroll {
 	overflow : auto; 
-	/*overflow-x : hidden;*/ 
+	overflow-x : hidden; 
 }
 
 .rich-combobox-list-cord { 

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-02-05 11:40:45 UTC (rev 5812)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-02-05 12:38:47 UTC (rev 5813)
@@ -392,7 +392,6 @@
 		this.listParent.style.visibility = "hidden";
 		this.listParent.show();
 		
-		this.LAYOUT_WIDTH = this.list.parentNode.scrollWidth;
 		var el = this.listParent.childNodes[1].firstChild;
 		this.LAYOUT_BORDER_V = Richfaces.getBorderWidth(el, "tb");
 		this.LAYOUT_BORDER_H = Richfaces.getBorderWidth(el, "lr");
@@ -504,7 +503,7 @@
 		if (Prototype.Browser.IE) {
 			height = parseInt(height) + this.LAYOUT_BORDER_V + this.LAYOUT_PADDING_V;
 		}
-		this.list.parentNode.style.height = height;
+		this.list.style.height = height;
 		if (this.iframe) {
 			this.iframe.style.height = height;			
 		}
@@ -522,7 +521,7 @@
 		this.setWidth(this.width);
 	},
 	
-	setWidth : function(width) {
+	/*setWidth : function(width) {
 		var positionElem = this.listParent.childNodes[1];
 		var combobox = this.listParent.parentNode;
 		combobox.style.width = width;
@@ -548,6 +547,18 @@
 		this.list.style.width = correction + "px";
 				
 		 
+	},*/
+	
+	setWidth : function(width) {
+		var positionElem = this.listParent.childNodes[1];
+		var combobox = this.listParent.parentNode;
+		//positionElem.style.width = width;
+		var correction = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr") + "px";
+		this.list.style.width = correction;
+		combobox.style.width = correction;
+		if (this.iframe) {
+			this.iframe.style.width = correction;			
+		}
 	},
 	
 	setPosition : function(fieldTop, fieldLeft, fieldHeight) {
@@ -578,7 +589,7 @@
 	
 	scrolling : function(event) {
 		var increment;
-		var scrollElem = this.list.parentNode;
+		var scrollElem = this.list;
 		var listTop = Richfaces.ComboBoxList.getElemXY(scrollElem).top;
 		var scrollTop = scrollElem.scrollTop;
 		var itemTop = Richfaces.ComboBoxList.getElemXY(this.activeItem).top;
@@ -599,7 +610,7 @@
 	},
 	
 	scrollingUpToItem : function(item) {
-		var scrollElem = this.list.parentNode;
+		var scrollElem = this.list;
 		var increment = (Richfaces.ComboBoxList.getElemXY(item).top - scrollElem.scrollTop) - Richfaces.ComboBoxList.getElemXY(scrollElem).top;
 		scrollElem.scrollTop += increment;
 	},
@@ -612,7 +623,6 @@
 		
 		this.activeItem = item;
 		
-		//this.activeItem.style.width = this.LAYOUT_WIDTH + "px"; //FIXME
 		this.changeItem(item, this.classes.ITEM.SELECTED);
 	},
 	
@@ -710,7 +720,7 @@
 	},
 	
 	createItem : function(text, className) {
-		return "<span class=\"" + className+ "\" style=\"width:" + this.LAYOUT_WIDTH + "px;\">" + text + "</span>";
+		return "<span class=\"" + className+ "\">" + text + "</span>";
 	},
 	
 	createIframe : function(parentElem, width, comboboxId, classes) {

Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-02-05 11:40:45 UTC (rev 5812)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-02-05 12:38:47 UTC (rev 5813)
@@ -248,8 +248,8 @@
 			</table>
 		</div>
 		<div id="listPosition#{clientId}" class="rich-combobox-list-position">
-			<div id="listDecoration#{clientId}" class="rich-combobox-list-decoration rich-combobox-list-scroll">
-				<div id="list#{clientId}">
+			<div id="listDecoration#{clientId}" class="rich-combobox-list-decoration">
+				<div id="list#{clientId}" class="rich-combobox-list-scroll">
 					<f:call name="encodeItems"/>
 				</div>
 			</div>




More information about the richfaces-svn-commits mailing list