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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/metro/base/content/bindings/flyoutpanel.xml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,107 @@
     1.4 +<?xml version="1.0"?>
     1.5 +
     1.6 +<bindings xmlns="http://www.mozilla.org/xbl"
     1.7 +          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     1.8 +          xmlns:xbl="http://www.mozilla.org/xbl">
     1.9 +
    1.10 +  <binding id="flyoutpanelBinding" extends="xul:box">
    1.11 +    <resources>
    1.12 +      <stylesheet src="chrome://browser/skin/flyoutpanel.css"/>
    1.13 +    </resources>
    1.14 +
    1.15 +    <content>
    1.16 +      <xul:vbox class="flyoutpanel-wrapper">
    1.17 +        <xul:hbox class="flyoutpanel-header" align="top">
    1.18 +          <xul:toolbarbutton class="flyout-close-button"
    1.19 +                             command="cmd_flyout_back"
    1.20 +                             xbl:inherits="command"/>
    1.21 +          <xul:label class="flyout-header-label" xbl:inherits="value=headertext"/>
    1.22 +        </xul:hbox>
    1.23 +        <xul:scrollbox class="flyoutpanel-contents" observes="bcast_preciseInput" flex="1" orient="vertical">
    1.24 +          <children/>
    1.25 +        </xul:scrollbox>
    1.26 +      </xul:vbox>
    1.27 +    </content>
    1.28 +
    1.29 +    <implementation>
    1.30 +      <constructor>
    1.31 +        <![CDATA[
    1.32 +            this.setAttribute("isSlidOut", true);
    1.33 +        ]]>
    1.34 +      </constructor>
    1.35 +      <method name="_onAfterSlideOut">
    1.36 +        <body>
    1.37 +          <![CDATA[
    1.38 +            this.removeAttribute("isSlidingOut");
    1.39 +            this.setAttribute("isSlidOut", true);
    1.40 +            this.removeAttribute("visible");
    1.41 +            this.removeEventListener("transitionend", this._onAfterSlideOut);
    1.42 +          ]]>
    1.43 +        </body>
    1.44 +      </method>
    1.45 +
    1.46 +      <method name="_onAfterSlideIn">
    1.47 +        <body>
    1.48 +          <![CDATA[
    1.49 +            this.removeAttribute("isSlidingIn");
    1.50 +            this.setAttribute("isSlidIn", true);
    1.51 +            this.removeEventListener("transitionend", this._onAfterSlideIn);
    1.52 +          ]]>
    1.53 +        </body>
    1.54 +      </method>
    1.55 +
    1.56 +      <method name="hide">
    1.57 +        <body>
    1.58 +          <![CDATA[
    1.59 +            if (this.hasAttribute("isSlidingOut")
    1.60 +             || this.hasAttribute("isSlidOut")) {
    1.61 +              return;
    1.62 +            }
    1.63 +
    1.64 +            if (this.hasAttribute("isSlidingIn")) {
    1.65 +              this._onAfterSlideIn();
    1.66 +            }
    1.67 +
    1.68 +            this.addEventListener("transitionend", this._onAfterSlideOut);
    1.69 +            this.classList.remove("flyoutpanel-slide-in");
    1.70 +            this.setAttribute("isSlidingOut", true);
    1.71 +            this.removeAttribute("isSlidIn");
    1.72 +
    1.73 +            let event = document.createEvent("Events");
    1.74 +            event.initEvent("MozFlyoutPanelHiding", true, false);
    1.75 +            this.dispatchEvent(event);
    1.76 +          ]]>
    1.77 +        </body>
    1.78 +      </method>
    1.79 +
    1.80 +      <method name="show">
    1.81 +        <body>
    1.82 +          <![CDATA[
    1.83 +            if (this.hasAttribute("isSlidingIn")
    1.84 +             || this.hasAttribute("isSlidIn")) {
    1.85 +              return;
    1.86 +            }
    1.87 +
    1.88 +            if (this.hasAttribute("isSlidingOut")) {
    1.89 +              this._onAfterSlideOut();
    1.90 +            }
    1.91 +
    1.92 +            let event = document.createEvent("Events");
    1.93 +            event.initEvent("MozFlyoutPanelShowing", true, false);
    1.94 +            this.dispatchEvent(event);
    1.95 +            this.classList.add("flyoutpanel-slide-in");
    1.96 +
    1.97 +            this.setAttribute("isSlidingIn", true);
    1.98 +            this.setAttribute("visible", true);
    1.99 +            this.removeAttribute("isSlidOut");
   1.100 +          ]]>
   1.101 +        </body>
   1.102 +      </method>
   1.103 +
   1.104 +      <field name="anonScrollBox" readonly="true"><![CDATA[
   1.105 +        // Expose the anyonymous scrollbox so ScrollUtils.getScrollboxFromElement can find it.
   1.106 +        document.getAnonymousElementByAttribute(this, "class", "flyoutpanel-contents");
   1.107 +      ]]></field>
   1.108 +    </implementation>
   1.109 +  </binding>
   1.110 +</bindings>

mercurial