Fix menubuttons to not rely on the "open" attribute opening menus; open them

via the boxobject.  Bug 282359, r=mconnor, sr=neil
This commit is contained in:
bzbarsky%mit.edu 2005-02-22 17:53:26 +00:00
parent bf95c180db
commit 56b2bc8030
2 changed files with 22 additions and 8 deletions

View File

@ -28,10 +28,17 @@
onget="return this.getAttribute('group');"
onset="this.setAttribute('group', val); return val;"/>
<property name="open"
onget="return this.hasAttribute('open');"
onset="if (val) this.setAttribute('open', 'true');
else this.removeAttribute('open'); return val;"/>
<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);
return val;
]]></setter>
</property>
<property name="checked" onget="return this.hasAttribute('checked');">
<setter><![CDATA[

View File

@ -28,10 +28,17 @@
onget="return this.getAttribute('group');"
onset="this.setAttribute('group', val); return val;"/>
<property name="open"
onget="return this.hasAttribute('open');"
onset="if (val) this.setAttribute('open', 'true');
else this.removeAttribute('open'); return val;"/>
<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);
return val;
]]></setter>
</property>
<property name="checked" onget="return this.hasAttribute('checked');">
<setter><![CDATA[