summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/expander.xml
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /toolkit/content/widgets/expander.xml
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/content/widgets/expander.xml')
-rw-r--r--toolkit/content/widgets/expander.xml86
1 files changed, 86 insertions, 0 deletions
diff --git a/toolkit/content/widgets/expander.xml b/toolkit/content/widgets/expander.xml
new file mode 100644
index 000000000..a4ffea313
--- /dev/null
+++ b/toolkit/content/widgets/expander.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<!-- 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/. -->
+
+<bindings id="expanderBindings"
+ 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">
+ <resources>
+ <stylesheet src="chrome://global/skin/expander.css"/>
+ </resources>
+ <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"/>
+ <xul:button anonid="clear-button" xbl:inherits="label=clearlabel,disabled=cleardisabled,hidden=clearhidden" mousethrough="always" icon="clear"/>
+ </xul:hbox>
+ <xul:vbox flex="1" anonid="settings" class="settingsContainer" collapsed="true" xbl:inherits="align">
+ <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>
+ <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
+ this.setAttribute("open", "false");
+ return val;
+ ]]>
+ </setter>
+ <getter>
+ return this.getAttribute("open");
+ </getter>
+ </property>
+ <method name="onCommand">
+ <parameter name="aEvent"/>
+ <body><![CDATA[
+ var element = aEvent.originalTarget;
+ var button = element.getAttribute("anonid");
+ switch (button) {
+ case "disclosure":
+ case "label":
+ if (this.open == "true")
+ this.open = false;
+ else
+ this.open = true;
+ break;
+ case "clear-button":
+ var event = document.createEvent("Events");
+ event.initEvent("clear", true, 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>
+
+