incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r503518 - in /incubator/xap/trunk/codebase/src/xap: bridges/xap/XapComboBoxBridge.js widgets/XapComboBox.js
Date Mon, 05 Feb 2007 00:17:47 GMT
Author: mturyn
Date: Sun Feb  4 16:17:46 2007
New Revision: 503518

URL: http://svn.apache.org/viewvc?view=rev&rev=503518
Log:
https://issues.apache.org/jira/browse/XAP-107
Fixed child listbox's extent dominating combobox's, now order of priority is (say) combobos.height,
listbox.height, default.

https://issues.apache.org/jira/browse/XAP-293
Combobox widths and heights settable with a percentage (except for heights under IE, which
are unsettable.).

Modified:
    incubator/xap/trunk/codebase/src/xap/bridges/xap/XapComboBoxBridge.js
    incubator/xap/trunk/codebase/src/xap/widgets/XapComboBox.js

Modified: incubator/xap/trunk/codebase/src/xap/bridges/xap/XapComboBoxBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/xap/XapComboBoxBridge.js?view=diff&rev=503518&r1=503517&r2=503518
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/xap/XapComboBoxBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/xap/XapComboBoxBridge.js Sun Feb  4 16:17:46
2007
@@ -106,7 +106,7 @@
 	this._childListbox.refreshSelectBox()	
 	// Now reset it to something else, if th
 	// tag attributes so demand:
-	this.setInitialBox() ;
+	this.resetBoxFromElement() ;
 
 		
 	
@@ -135,7 +135,10 @@
 
 
 
-xap.bridges.xap.XapComboBoxBridge.prototype.setInitialBox = function(){
+xap.bridges.xap.XapComboBoxBridge.prototype.resetBoxFromElement = function(){
+	if( !this._childHandler ){
+		return ;
+	}
 	var desiredLBHeight = this._childHandler.getElement().getAttribute("height");
 	var desiredCBHeight = this.getElement().getAttribute("height") ;
 	// For the case when there's a listbox height but no combobbox height:
@@ -249,6 +252,8 @@
 }
 xap.bridges.xap.XapComboBoxBridge.prototype.setBorderWidthAttribute = function(value){
 	this.getPeer().setBorderWidth( value ) ;
+	// Changing border widths can change box unpleasantly:	
+	this.resetBoxFromElement() ;
 }
 
 xap.bridges.xap.XapComboBoxBridge.prototype.setXAttribute = function(value){

Modified: incubator/xap/trunk/codebase/src/xap/widgets/XapComboBox.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/XapComboBox.js?view=diff&rev=503518&r1=503517&r2=503518
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/XapComboBox.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/XapComboBox.js Sun Feb  4 16:17:46 2007
@@ -89,21 +89,40 @@
 }
 
 
-xap.widgets.XapComboBox.prototype.setWidth = function(value) {
-	this.domNode.style.width = value ;
-	if(this.child){
-		this.child.setWidth( "100%" ) ;
-	}	
-}
 
-xap.widgets.XapComboBox.prototype.setHeight = function(value) {
-	this.domNode.style.height = value;
-	if(this.child){
-		this.child.setHeight( value ) ;
-	}	
+xap.widgets.XapComboBox.prototype.setWidth = function (value) {
+	this.domNode.style.width = value;
+	// Need to do this first to (in essence) figure
+	// out what border, padding, margin will be if 
+	// the "value" argument is a percentage:
+	dojo.style.setOuterWidth(this.domNode, this.domNode.clientWidth);
 	
-	this.fixIe6Height() ;			
-}
+	if (this.child) {
+		this.child.setWidth("100%");
+	}
+
+};
+xap.widgets.XapComboBox.prototype.setHeight = function (value) {
+
+	// Need to do this first to (in essence) figure
+	// out what border, padding, margin will be if 
+	// the "value" argument is a percentage:
+	this.domNode.style.height = value;
+	dojo.style.setOuterHeight(this.domNode, this.domNode.clientHeight);
+
+	if (this.child) {
+		this.child.setHeight("100%");
+		var newHeight = this.domNode.clientHeight ;
+		if( window.netscape ){
+			// For once, Mozilla handles something
+			// worse than does Internet Explorer:
+			var fudgeDelta = 2 ;
+			newHeight = Math.max(newHeight - fudgeDelta,0) ;
+		}
+		dojo.style.setOuterHeight(this.child.select, newHeight);
+	}
+	this.fixIe6Height() ;
+};
 
 
 xap.widgets.XapComboBox.prototype.fixIe6Height = function() {
@@ -119,6 +138,7 @@
 xap.widgets.XapComboBox.prototype.setBorderStyle = function(value){
 	this.domNode.style.borderStyle = value  ;
 }
+
 xap.widgets.XapComboBox.prototype.setBorderWidth = function(value){
 	this.domNode.style.borderWidth = value  ;
 }



Mime
View raw message