incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r581465 - /incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js
Date Wed, 03 Oct 2007 01:22:23 GMT
Author: jmargaris
Date: Tue Oct  2 18:22:23 2007
New Revision: 581465

URL: http://svn.apache.org/viewvc?rev=581465&view=rev
Log:
efficiency changes

Modified:
    incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js

Modified: incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js?rev=581465&r1=581464&r2=581465&view=diff
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js Tue Oct  2 18:22:23 2007
@@ -75,25 +75,26 @@
 
 		addChild:function(child){
 			var select = this.select ;
-			this.select.options[this.select.options.length] = child.domNode;
+			select.options[select.options.length] = child.domNode;
 			if (this.isCombobox){
 				
 			}
 			else{
-				this.select.size=this.select.options.length<2?2:this.select.options.length;
+			//	this.select.size=this.select.options.length<2?2:this.select.options.length;
 			}
 			
-		},
+	},
 		
 		removeChild: function(child) {
 			var options = this.select.options;	
-			for (var i = 0; i < options.length; i++) {
-				if (options[i] == child.domNode){
+			for (var i =options.length-1; i >=0 ; i--) {
+				if (options[i] === child.domNode){
 					options[i] = null;
+					break;
 					if (this.isCombobox){
 						
 					}else{
-						this.select.size = 2>this.select.options.length?2:this.select.options.length;
+					//	this.select.size = 2>this.select.options.length?2:this.select.options.length;
 					}
 				}
 			}					



Mime
View raw message