2003-02-01 12:15:36 +03:00
|
|
|
<?xml version="1.0"?>
|
2012-05-21 15:12:37 +04:00
|
|
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
|
|
|
2003-08-07 04:38:59 +04:00
|
|
|
<bindings id="expanderBindings"
|
2003-02-01 12:15:36 +03: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 04:38:59 +04:00
|
|
|
<resources>
|
|
|
|
<stylesheet src="chrome://global/skin/expander.css"/>
|
|
|
|
</resources>
|
2003-02-01 12:15:36 +03: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"/>
|
2005-03-02 13:53:06 +03:00
|
|
|
<xul:button anonid="clear-button" xbl:inherits="label=clearlabel,disabled=cleardisabled,hidden=clearhidden" mousethrough="always" icon="clear"/>
|
2003-02-01 12:15:36 +03:00
|
|
|
</xul:hbox>
|
2004-04-21 12:48:30 +04:00
|
|
|
<xul:vbox flex="1" anonid="settings" class="settingsContainer" collapsed="true" xbl:inherits="align">
|
2003-02-01 12:15:36 +03:00
|
|
|
<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>
|
2003-08-24 08:50:59 +04:00
|
|
|
<property name="open">
|
|
|
|
<setter>
|
|
|
|
<![CDATA[
|
|
|
|
var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings");
|
|
|
|
var expander = document.getAnonymousElementByAttribute(this, "anonid", "disclosure");
|
|
|
|
settings.collapsed = !val;
|
|
|
|
expander.open = val;
|
|
|
|
if (val)
|
|
|
|
this.setAttribute("open", "true");
|
|
|
|
else
|
2004-05-07 04:52:53 +04:00
|
|
|
this.setAttribute("open", "false");
|
2003-08-24 08:50:59 +04:00
|
|
|
return val;
|
|
|
|
]]>
|
|
|
|
</setter>
|
|
|
|
<getter>
|
|
|
|
return this.getAttribute("open");
|
|
|
|
</getter>
|
|
|
|
</property>
|
2003-02-01 12:15:36 +03:00
|
|
|
<method name="onCommand">
|
|
|
|
<parameter name="aEvent"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
var element = aEvent.originalTarget;
|
|
|
|
var button = element.getAttribute("anonid");
|
|
|
|
switch (button) {
|
|
|
|
case "disclosure":
|
|
|
|
case "label":
|
2004-05-07 04:52:53 +04:00
|
|
|
if (this.open == "true")
|
|
|
|
this.open = false;
|
|
|
|
else
|
|
|
|
this.open = true;
|
2003-02-01 12:15:36 +03:00
|
|
|
break;
|
|
|
|
case "clear-button":
|
|
|
|
var event = document.createEvent("Events");
|
2006-03-13 00:04:39 +03:00
|
|
|
event.initEvent("clear", true, true);
|
2003-02-01 12:15:36 +03:00
|
|
|
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>
|
|
|
|
|
2006-03-13 00:04:39 +03:00
|
|
|
|