You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2007/10/03 01:22:23 UTC
svn commit: r581465 -
/incubator/xap/trunk/codebase/src/xap/widgets/ListBox.js
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;
}
}
}