Fix 48180: menulists don't respect data attribute (add-on to previous fix). patch by Jan Varga (varga@utcru.sk). r=jag a=ben

This commit is contained in:
blakeross%telocity.com 2000-12-07 04:29:53 +00:00
parent 2463c6c216
commit d8a2ec6f7a

View File

@ -34,11 +34,11 @@
<body> <body>
<![CDATA[ <![CDATA[
this.setAttribute('sizetopopup', 'true'); this.setAttribute('sizetopopup', 'true');
if (!this.value) { if (!this.value && this.childNodes.length) {
var arr = this.getElementsByAttribute('selected', 'true'); var arr = this.firstChild.getElementsByAttribute('selected', 'true');
if (!arr.length && this.data) if (!arr.length && this.data)
arr = this.getElementsByAttribute('data', this.data); arr = this.firstChild.getElementsByAttribute('data', this.data);
if (arr.length) if (arr.length)
this.selectedItem = arr[0]; this.selectedItem = arr[0];
@ -51,11 +51,16 @@
<property name="data" onget="return this.getAttribute('data');"> <property name="data" onget="return this.getAttribute('data');">
<setter> <setter>
<![CDATA[ <![CDATA[
var arr = this.getElementsByAttribute('data', val); var arr;
if (arr.length)
if (this.childNodes.length)
arr = this.firstChild.getElementsByAttribute('data', val);
if (arr && arr.length)
this.selectedItem = arr[0]; this.selectedItem = arr[0];
else else
this.setAttribute('data', val); this.setAttribute('data', val);
return val; return val;
]]> ]]>
</setter> </setter>