| 1 |
// $Id: activeselect.js,v 1.15 2006/03/29 12:51:48 jaza Exp $ |
// $Id: activeselect.js,v 1.16 2006/04/09 05:11:52 jaza Exp $ |
| 2 |
|
|
| 3 |
// Global Killswitch |
// Global Killswitch |
| 4 |
if (isJsEnabled()) { |
if (isJsEnabled()) { |
| 80 |
} |
} |
| 81 |
} |
} |
| 82 |
this.setSelectWidth(maxWidth); |
this.setSelectWidth(maxWidth); |
| 83 |
|
|
| 84 |
return selectedOptions.join('||'); |
return selectedOptions.join('||'); |
| 85 |
} |
} |
| 86 |
|
|
| 87 |
/** |
/** |
| 88 |
* Sets the width of the activeselect element, and adjusts the position of the |
* Sets the width of the activeselect element, and adjusts the position of the |
| 89 |
* throbber background image |
* throbber background image |
| 90 |
*/ |
*/ |
| 91 |
jsAS.prototype.setSelectWidth = function (width) { |
jsAS.prototype.setSelectWidth = function (width) { |
| 142 |
this.targets[targetIndex].name = target.name.substr(0, target.name.length-2); |
this.targets[targetIndex].name = target.name.substr(0, target.name.length-2); |
| 143 |
} |
} |
| 144 |
} |
} |
| 145 |
|
|
| 146 |
while (target.hasChildNodes()) { |
while (target.hasChildNodes()) { |
| 147 |
target.removeChild(target.childNodes[0]); |
target.removeChild(target.childNodes[0]); |
| 148 |
} |
} |
| 152 |
var value = currMatch; |
var value = currMatch; |
| 153 |
var text = targetMatches[currMatch]['value']; |
var text = targetMatches[currMatch]['value']; |
| 154 |
var selected = targetMatches[currMatch]['selected']; |
var selected = targetMatches[currMatch]['selected']; |
| 155 |
|
|
| 156 |
if (text.length > maxWidth) { |
if (text.length > maxWidth) { |
| 157 |
maxWidth = text.length; |
maxWidth = text.length; |
| 158 |
} |
} |
| 160 |
// display option text if the latter method is used (otherwise they seem |
// display option text if the latter method is used (otherwise they seem |
| 161 |
// to behave the same). |
// to behave the same). |
| 162 |
this.targets[targetIndex].options[this.targets[targetIndex].options.length] = new Option(text, value, false, selected); |
this.targets[targetIndex].options[this.targets[targetIndex].options.length] = new Option(text, value, false, selected); |
| 163 |
|
if (selected && !this.targets[targetIndex].multiple) { |
| 164 |
|
this.targets[targetIndex].selectedIndex = this.targets[targetIndex].options.length-1; |
| 165 |
|
} |
| 166 |
} |
} |
| 167 |
if (this.targets[targetIndex].selectedIndex == -1) { |
if (this.targets[targetIndex].selectedIndex == -1) { |
| 168 |
this.targets[targetIndex].selectedIndex = 0; |
this.targets[targetIndex].selectedIndex = 0; |