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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <?xml version="1.0"?>
     3 <bindings xmlns="http://www.mozilla.org/xbl"
     4           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     5   <binding id="appbarBinding">
     6     <content>
     7       <xul:toolbar anonid="toolbar"><children/></xul:toolbar>
     8     </content>
    10     <implementation implements="nsIDOMEventListener">
    11       <field name="sticky">false</field>
    12       <field name="_toolbar" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "toolbar");</field>
    14       <property name="isShowing" readonly="true">
    15         <getter>
    16           <![CDATA[
    17             return this.getAttribute("visible") == "true";
    18           ]]>
    19         </getter>
    20       </property>
    22       <method name="_fire">
    23         <parameter name="aName"/>
    24         <body>
    25           <![CDATA[
    26             let event = document.createEvent("Events");
    27             event.initEvent(aName, true, false);
    28             this.dispatchEvent(event);
    29           ]]>
    30         </body>
    31       </method>
    33       <method name="dismiss">
    34         <body>
    35           <![CDATA[
    36             if (!this.isShowing)
    37               return;
    39             let self = this;
    40             this.setAttribute("hiding", "true");
    41             this.addEventListener("transitionend", function appbar_transitionend() {
    42               self.removeEventListener("transitionend", appbar_transitionend, false);
    43               self.removeAttribute("hiding");
    44             }, false);
    46             this._fire("MozAppbarDismissing");
    47             this.removeAttribute("visible");
    48           ]]>
    49         </body>
    50       </method>
    52       <method name="show">
    53         <body>
    54           <![CDATA[
    55             if (this.isShowing)
    56               return;
    58             this._fire("MozAppbarShowing");
    59             this.setAttribute("visible", "true");
    60           ]]>
    61         </body>
    62       </method>
    64       <method name="toggle">
    65         <body>
    66           <![CDATA[
    67             if (this.getAttribute("visible") === "true") {
    68               this.dismiss();
    69             } else {
    70               this.show();
    71             }
    72           ]]>
    73         </body>
    74       </method>
    75     </implementation>
    76   </binding>
    77 </bindings>

mercurial