browser/metro/base/content/bindings/flyoutpanel.xml

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 <?xml version="1.0"?>
michael@0 2
michael@0 3 <bindings xmlns="http://www.mozilla.org/xbl"
michael@0 4 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
michael@0 5 xmlns:xbl="http://www.mozilla.org/xbl">
michael@0 6
michael@0 7 <binding id="flyoutpanelBinding" extends="xul:box">
michael@0 8 <resources>
michael@0 9 <stylesheet src="chrome://browser/skin/flyoutpanel.css"/>
michael@0 10 </resources>
michael@0 11
michael@0 12 <content>
michael@0 13 <xul:vbox class="flyoutpanel-wrapper">
michael@0 14 <xul:hbox class="flyoutpanel-header" align="top">
michael@0 15 <xul:toolbarbutton class="flyout-close-button"
michael@0 16 command="cmd_flyout_back"
michael@0 17 xbl:inherits="command"/>
michael@0 18 <xul:label class="flyout-header-label" xbl:inherits="value=headertext"/>
michael@0 19 </xul:hbox>
michael@0 20 <xul:scrollbox class="flyoutpanel-contents" observes="bcast_preciseInput" flex="1" orient="vertical">
michael@0 21 <children/>
michael@0 22 </xul:scrollbox>
michael@0 23 </xul:vbox>
michael@0 24 </content>
michael@0 25
michael@0 26 <implementation>
michael@0 27 <constructor>
michael@0 28 <![CDATA[
michael@0 29 this.setAttribute("isSlidOut", true);
michael@0 30 ]]>
michael@0 31 </constructor>
michael@0 32 <method name="_onAfterSlideOut">
michael@0 33 <body>
michael@0 34 <![CDATA[
michael@0 35 this.removeAttribute("isSlidingOut");
michael@0 36 this.setAttribute("isSlidOut", true);
michael@0 37 this.removeAttribute("visible");
michael@0 38 this.removeEventListener("transitionend", this._onAfterSlideOut);
michael@0 39 ]]>
michael@0 40 </body>
michael@0 41 </method>
michael@0 42
michael@0 43 <method name="_onAfterSlideIn">
michael@0 44 <body>
michael@0 45 <![CDATA[
michael@0 46 this.removeAttribute("isSlidingIn");
michael@0 47 this.setAttribute("isSlidIn", true);
michael@0 48 this.removeEventListener("transitionend", this._onAfterSlideIn);
michael@0 49 ]]>
michael@0 50 </body>
michael@0 51 </method>
michael@0 52
michael@0 53 <method name="hide">
michael@0 54 <body>
michael@0 55 <![CDATA[
michael@0 56 if (this.hasAttribute("isSlidingOut")
michael@0 57 || this.hasAttribute("isSlidOut")) {
michael@0 58 return;
michael@0 59 }
michael@0 60
michael@0 61 if (this.hasAttribute("isSlidingIn")) {
michael@0 62 this._onAfterSlideIn();
michael@0 63 }
michael@0 64
michael@0 65 this.addEventListener("transitionend", this._onAfterSlideOut);
michael@0 66 this.classList.remove("flyoutpanel-slide-in");
michael@0 67 this.setAttribute("isSlidingOut", true);
michael@0 68 this.removeAttribute("isSlidIn");
michael@0 69
michael@0 70 let event = document.createEvent("Events");
michael@0 71 event.initEvent("MozFlyoutPanelHiding", true, false);
michael@0 72 this.dispatchEvent(event);
michael@0 73 ]]>
michael@0 74 </body>
michael@0 75 </method>
michael@0 76
michael@0 77 <method name="show">
michael@0 78 <body>
michael@0 79 <![CDATA[
michael@0 80 if (this.hasAttribute("isSlidingIn")
michael@0 81 || this.hasAttribute("isSlidIn")) {
michael@0 82 return;
michael@0 83 }
michael@0 84
michael@0 85 if (this.hasAttribute("isSlidingOut")) {
michael@0 86 this._onAfterSlideOut();
michael@0 87 }
michael@0 88
michael@0 89 let event = document.createEvent("Events");
michael@0 90 event.initEvent("MozFlyoutPanelShowing", true, false);
michael@0 91 this.dispatchEvent(event);
michael@0 92 this.classList.add("flyoutpanel-slide-in");
michael@0 93
michael@0 94 this.setAttribute("isSlidingIn", true);
michael@0 95 this.setAttribute("visible", true);
michael@0 96 this.removeAttribute("isSlidOut");
michael@0 97 ]]>
michael@0 98 </body>
michael@0 99 </method>
michael@0 100
michael@0 101 <field name="anonScrollBox" readonly="true"><![CDATA[
michael@0 102 // Expose the anyonymous scrollbox so ScrollUtils.getScrollboxFromElement can find it.
michael@0 103 document.getAnonymousElementByAttribute(this, "class", "flyoutpanel-contents");
michael@0 104 ]]></field>
michael@0 105 </implementation>
michael@0 106 </binding>
michael@0 107 </bindings>

mercurial