Vitaliy977
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Код: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> <binding id="findbar"> <implementation> <field name="panelcontainer">document.getAnonymousElementByAttribute(document.getElementById("content"), "anonid", "panelcontainer");</field> <field name="findtoolbar">document.getElementById("FindToolbar");</field> <field name="timer">null</field> <constructor><![CDATA[ this._topwidthfindbar(); window.addEventListener("resize", this, false); ]]></constructor> <destructor><![CDATA[ window.removeEventListener("resize", this, false); ]]></destructor> <method name="handleEvent"> <parameter name="event"/> <body><![CDATA[ this.topwidthfindbar(); ]]></body> </method> <method name="topwidthfindbar"> <body><![CDATA[ clearTimeout(this.timer); this.timer = setTimeout(() => this._topwidthfindbar(), 200); ]]></body> </method> <method name="_topwidthfindbar"> <body><![CDATA[ var margintop = this.panelcontainer.boxObject.y; var widthfindbar = this.panelcontainer.boxObject.width - 16; this.findtoolbar.setAttribute("style", "top: " + margintop + "px !important; max-width: " + (widthfindbar > 16 ? widthfindbar : 4) + "px !important; position: fixed;"); ]]></body> </method> </implementation> </binding> </bindings> |
|