Fixed not checking for child nodes in menulist constructor, b=103310, r=brade, sr=sfraser

This commit is contained in:
cmanske%netscape.com 2001-10-10 21:34:12 +00:00
Родитель 153d61338a
Коммит 60867fd4da
1 изменённых файлов: 15 добавлений и 14 удалений

Просмотреть файл

@ -47,20 +47,22 @@
<![CDATA[
this.setAttribute('sizetopopup', 'true');
// if there was a previously selected item, be sure to set our internal
// selection memory to that item so we can un-set it properly later on
var arr = this.firstChild.getElementsByAttribute('selected', 'true');
if (arr.length)
this.selectedInternal = arr[0];
if (!this.label && this.childNodes.length) {
if (!arr.length && this.value)
arr = this.firstChild.getElementsByAttribute('value', this.value);
if (this.childNodes.length) {
// if there was a previously selected item, be sure to set our internal
// selection memory to that item so we can un-set it properly later on
var arr = this.firstChild.getElementsByAttribute('selected', 'true');
if (arr.length)
this.selectedItem = arr[0];
else
this.selectedIndex = 0;
this.selectedInternal = arr[0];
if (!this.label && this.childNodes.length) {
if (!arr.length && this.value)
arr = this.firstChild.getElementsByAttribute('value', this.value);
if (arr.length)
this.selectedItem = arr[0];
else
this.selectedIndex = 0;
}
}
]]>
</body>
@ -186,7 +188,6 @@
// to automatically select the inputField.value in the list
if (!this.getAttribute("autoSelectMenuitem"))
this.setAttribute("autoSelectMenuitem", "true");
]]></constructor>
<method name="_selectInputFieldValueInList">