1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/metro/base/content/bindings/appbar.xml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,77 @@ 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 + <binding id="appbarBinding"> 1.9 + <content> 1.10 + <xul:toolbar anonid="toolbar"><children/></xul:toolbar> 1.11 + </content> 1.12 + 1.13 + <implementation implements="nsIDOMEventListener"> 1.14 + <field name="sticky">false</field> 1.15 + <field name="_toolbar" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "toolbar");</field> 1.16 + 1.17 + <property name="isShowing" readonly="true"> 1.18 + <getter> 1.19 + <![CDATA[ 1.20 + return this.getAttribute("visible") == "true"; 1.21 + ]]> 1.22 + </getter> 1.23 + </property> 1.24 + 1.25 + <method name="_fire"> 1.26 + <parameter name="aName"/> 1.27 + <body> 1.28 + <![CDATA[ 1.29 + let event = document.createEvent("Events"); 1.30 + event.initEvent(aName, true, false); 1.31 + this.dispatchEvent(event); 1.32 + ]]> 1.33 + </body> 1.34 + </method> 1.35 + 1.36 + <method name="dismiss"> 1.37 + <body> 1.38 + <![CDATA[ 1.39 + if (!this.isShowing) 1.40 + return; 1.41 + 1.42 + let self = this; 1.43 + this.setAttribute("hiding", "true"); 1.44 + this.addEventListener("transitionend", function appbar_transitionend() { 1.45 + self.removeEventListener("transitionend", appbar_transitionend, false); 1.46 + self.removeAttribute("hiding"); 1.47 + }, false); 1.48 + 1.49 + this._fire("MozAppbarDismissing"); 1.50 + this.removeAttribute("visible"); 1.51 + ]]> 1.52 + </body> 1.53 + </method> 1.54 + 1.55 + <method name="show"> 1.56 + <body> 1.57 + <![CDATA[ 1.58 + if (this.isShowing) 1.59 + return; 1.60 + 1.61 + this._fire("MozAppbarShowing"); 1.62 + this.setAttribute("visible", "true"); 1.63 + ]]> 1.64 + </body> 1.65 + </method> 1.66 + 1.67 + <method name="toggle"> 1.68 + <body> 1.69 + <![CDATA[ 1.70 + if (this.getAttribute("visible") === "true") { 1.71 + this.dismiss(); 1.72 + } else { 1.73 + this.show(); 1.74 + } 1.75 + ]]> 1.76 + </body> 1.77 + </method> 1.78 + </implementation> 1.79 + </binding> 1.80 +</bindings>