Wed, 31 Dec 2014 06:55:50 +0100
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 | <binding id="appbarBinding"> |
michael@0 | 6 | <content> |
michael@0 | 7 | <xul:toolbar anonid="toolbar"><children/></xul:toolbar> |
michael@0 | 8 | </content> |
michael@0 | 9 | |
michael@0 | 10 | <implementation implements="nsIDOMEventListener"> |
michael@0 | 11 | <field name="sticky">false</field> |
michael@0 | 12 | <field name="_toolbar" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "toolbar");</field> |
michael@0 | 13 | |
michael@0 | 14 | <property name="isShowing" readonly="true"> |
michael@0 | 15 | <getter> |
michael@0 | 16 | <![CDATA[ |
michael@0 | 17 | return this.getAttribute("visible") == "true"; |
michael@0 | 18 | ]]> |
michael@0 | 19 | </getter> |
michael@0 | 20 | </property> |
michael@0 | 21 | |
michael@0 | 22 | <method name="_fire"> |
michael@0 | 23 | <parameter name="aName"/> |
michael@0 | 24 | <body> |
michael@0 | 25 | <![CDATA[ |
michael@0 | 26 | let event = document.createEvent("Events"); |
michael@0 | 27 | event.initEvent(aName, true, false); |
michael@0 | 28 | this.dispatchEvent(event); |
michael@0 | 29 | ]]> |
michael@0 | 30 | </body> |
michael@0 | 31 | </method> |
michael@0 | 32 | |
michael@0 | 33 | <method name="dismiss"> |
michael@0 | 34 | <body> |
michael@0 | 35 | <![CDATA[ |
michael@0 | 36 | if (!this.isShowing) |
michael@0 | 37 | return; |
michael@0 | 38 | |
michael@0 | 39 | let self = this; |
michael@0 | 40 | this.setAttribute("hiding", "true"); |
michael@0 | 41 | this.addEventListener("transitionend", function appbar_transitionend() { |
michael@0 | 42 | self.removeEventListener("transitionend", appbar_transitionend, false); |
michael@0 | 43 | self.removeAttribute("hiding"); |
michael@0 | 44 | }, false); |
michael@0 | 45 | |
michael@0 | 46 | this._fire("MozAppbarDismissing"); |
michael@0 | 47 | this.removeAttribute("visible"); |
michael@0 | 48 | ]]> |
michael@0 | 49 | </body> |
michael@0 | 50 | </method> |
michael@0 | 51 | |
michael@0 | 52 | <method name="show"> |
michael@0 | 53 | <body> |
michael@0 | 54 | <![CDATA[ |
michael@0 | 55 | if (this.isShowing) |
michael@0 | 56 | return; |
michael@0 | 57 | |
michael@0 | 58 | this._fire("MozAppbarShowing"); |
michael@0 | 59 | this.setAttribute("visible", "true"); |
michael@0 | 60 | ]]> |
michael@0 | 61 | </body> |
michael@0 | 62 | </method> |
michael@0 | 63 | |
michael@0 | 64 | <method name="toggle"> |
michael@0 | 65 | <body> |
michael@0 | 66 | <![CDATA[ |
michael@0 | 67 | if (this.getAttribute("visible") === "true") { |
michael@0 | 68 | this.dismiss(); |
michael@0 | 69 | } else { |
michael@0 | 70 | this.show(); |
michael@0 | 71 | } |
michael@0 | 72 | ]]> |
michael@0 | 73 | </body> |
michael@0 | 74 | </method> |
michael@0 | 75 | </implementation> |
michael@0 | 76 | </binding> |
michael@0 | 77 | </bindings> |