xul arrowpanel 处理程序
我试图在弹出窗口打开时设置 popupshowing 处理程序,以便我可以动态设置“.panel-arrow”的 margin-right 我尝试使用 XUL 绑定,当弹出窗口显示时,我将设置“.panel-arrow”的 margin-right。动态面板箭头”。
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="panelext_panel_arrow_binding" extends="chrome://global/content/bindings/popup.xml#arrowpanel">
<resources>
<stylesheet src="chrome://panelext/skin/panel.css"/>
</resources>
<handlers>
<handler event="popupshowing">
<![CDATA[
var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage("panelext CHECK");
]]>
</handler>
</handlers>
</binding>
</bindings>
资源绑定有效,但处理程序无效。
I am trying to set popupshowing handler when the popup opens so I can set the margin-right of the ".panel-arrow" dynamically I tried to use XUL Bindings and when the popup shows I will set the margin-right of the ".panel-arrow" dynamically.
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="panelext_panel_arrow_binding" extends="chrome://global/content/bindings/popup.xml#arrowpanel">
<resources>
<stylesheet src="chrome://panelext/skin/panel.css"/>
</resources>
<handlers>
<handler event="popupshowing">
<![CDATA[
var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage("panelext CHECK");
]]>
</handler>
</handlers>
</binding>
</bindings>
The resource binding is workings but the handlers isn`t.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是把它复杂化了 - 修复方法只是将 onpopupshowing="EXTENSION_NAME.popupshowing()" 添加到面板中。
I just complicated it - the fix is just to add onpopupshowing="EXTENSION_NAME.popupshowing()" to the panel.