2003-02-01 09:15:36 +00:00
|
|
|
<?xml version="1.0"?>
|
2003-08-07 00:38:59 +00:00
|
|
|
<bindings id="expanderBindings"
|
2003-02-01 09:15:36 +00:00
|
|
|
xmlns="http://www.mozilla.org/xbl"
|
|
|
|
xmlns:xbl="http://www.mozilla.org/xbl"
|
|
|
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
|
|
|
|
|
|
<binding id="expander" display="xul:vbox">
|
2003-08-07 00:38:59 +00:00
|
|
|
<resources>
|
|
|
|
<stylesheet src="chrome://global/skin/expander.css"/>
|
|
|
|
</resources>
|
2003-02-01 09:15:36 +00:00
|
|
|
<content>
|
|
|
|
<xul:hbox align="center">
|
|
|
|
<xul:button type="disclosure" class="expanderButton" anonid="disclosure" xbl:inherits="disabled" mousethrough="always"/>
|
|
|
|
<xul:label class="header expanderButton" anonid="label" xbl:inherits="value=label,disabled" mousethrough="always" flex="1"/>
|
2003-08-07 00:38:59 +00:00
|
|
|
<xul:button anonid="clear-button" xbl:inherits="label=clearlabel,disabled=cleardisabled,hidden=clearhidden" mousethrough="always"/>
|
2003-02-01 09:15:36 +00:00
|
|
|
</xul:hbox>
|
|
|
|
<xul:vbox flex="1" anonid="settings" class="settingsContainer" collapsed="true">
|
|
|
|
<children/>
|
|
|
|
</xul:vbox>
|
|
|
|
</content>
|
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings");
|
|
|
|
var expander = document.getAnonymousElementByAttribute(this, "anonid", "disclosure");
|
|
|
|
var open = this.getAttribute("open") == "true";
|
|
|
|
settings.collapsed = !open;
|
|
|
|
expander.open = open;
|
|
|
|
]]></constructor>
|
|
|
|
<method name="onCommand">
|
|
|
|
<parameter name="aEvent"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
var element = aEvent.originalTarget;
|
|
|
|
var button = element.getAttribute("anonid");
|
|
|
|
switch (button) {
|
|
|
|
case "disclosure":
|
|
|
|
case "label":
|
|
|
|
var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings");
|
|
|
|
settings.collapsed = !settings.collapsed;
|
|
|
|
var disclosure = document.getAnonymousElementByAttribute(this, "anonid", "disclosure");
|
|
|
|
disclosure.open = !disclosure.open;
|
|
|
|
this.setAttribute("open", disclosure.open);
|
|
|
|
break;
|
|
|
|
case "clear-button":
|
|
|
|
var event = document.createEvent("Events");
|
|
|
|
event.initEvent("clear", false, true);
|
|
|
|
this.dispatchEvent(event);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
</implementation>
|
|
|
|
<handlers>
|
|
|
|
<handler event="command"><![CDATA[
|
|
|
|
this.onCommand(event);
|
|
|
|
]]></handler>
|
|
|
|
<handler event="click"><![CDATA[
|
|
|
|
if (event.originalTarget.localName == "label")
|
|
|
|
this.onCommand(event);
|
|
|
|
]]></handler>
|
|
|
|
</handlers>
|
|
|
|
</binding>
|
|
|
|
|
|
|
|
</bindings>
|
|
|
|
|
|
|
|
|