Allow setting "open" property on all sorts of buttons, since people do.... Bug

282359, r=mconnor, sr=neil
This commit is contained in:
bzbarsky%mit.edu 2005-02-23 03:37:24 +00:00
Родитель e1a7049710
Коммит c79b003bca
2 изменённых файлов: 22 добавлений и 12 удалений

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

@ -30,12 +30,17 @@
<property name="open" onget="return this.hasAttribute('open');">
<setter><![CDATA[
// Note that the QI may throw if we're not a menu, but we want that
// to happen, since in that case setting our "open" property is
// somewhat bogus
this.boxObject
.QueryInterface(Components.interfaces.nsIMenuBoxObject)
.openMenu(val);
if (this.boxObject instanceof
Components.interfaces.nsIMenuBoxObject) {
this.boxObject.openMenu(val);
} else {
// Fall back to just setting the attribute
if (val) {
this.setAttribute('open', 'true');
} else {
this.removeAttribute('open');
}
}
return val;
]]></setter>
</property>

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

@ -30,12 +30,17 @@
<property name="open" onget="return this.hasAttribute('open');">
<setter><![CDATA[
// Note that the QI may throw if we're not a menu, but we want that
// to happen, since in that case setting our "open" property is
// somewhat bogus
this.boxObject
.QueryInterface(Components.interfaces.nsIMenuBoxObject)
.openMenu(val);
if (this.boxObject instanceof
Components.interfaces.nsIMenuBoxObject) {
this.boxObject.openMenu(val);
} else {
// Fall back to just setting the attribute
if (val) {
this.setAttribute('open', 'true');
} else {
this.removeAttribute('open');
}
}
return val;
]]></setter>
</property>