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
すると、割り当てられたコマンドが正常に実行されます。問題は、 を無効にしcommand
ても、対応する の無効状態には影響せず、toolbarbutton
有効のままです。なぜそれが機能しないのか、誰にも分かりますか?
ありがとうございました!