2

我正在制作一个在 Windows 上的 XULRunner 中运行的应用程序。

在那里,我创建了browser-toolbar将在不同地方使用的绑定。虽然绑定需要看起来相同,但它应该在按钮单击时执行不同的命令。

我正在尝试像这样完成它(代码被简化,命名空间被删除):

<binding id="custom-browser-type-a">
  <content>
    <commandset>
      <command id="TypeA:Home" oncommand="home()"/>
      <command id="TypeA:Back" oncommand="back()"/>
    </commandset>
    <browser-toolbar cmd_home="TypeA:Home" cmd_back="TypeA:Back" ... />
    <browser/>
  </content>
  <implementation>
  ...
  </implementation>
</binding>

<binding id="browser-toolbar">
  <content>
    <toolbar>
      <toolbarbutton label="Home" xbl:inherits="command=cmd_home"/>
      <toolbarbutton label="Back" xbl:inherits="command=cmd_back"/>
      ...
    </toolbar>        
  </content>
</binding>

一旦单击toolbarbutton执行分配的命令就好了。问题是当我禁用 acommand它不会影响相应的禁用状态时toolbarbutton,它会保持启用状态。有谁知道为什么这不起作用?

谢谢!

4

0 回答 0