diff --git a/content/treestyletab/treestyletab.xul b/content/treestyletab/treestyletab.xul index 574b6731..26be71ad 100644 --- a/content/treestyletab/treestyletab.xul +++ b/content/treestyletab/treestyletab.xul @@ -67,13 +67,13 @@ label="&selection.removeTabSubtree.label;" accesskey="&selection.removeTabSubtree.accesskey;" oncommand="TreeStyleTabService.removeTabSubtree(MultipleTabService.getSelectedTabs());" - multipletab-available="selectedTabs.length"/> + multipletab-available="any-selected"/> + multipletab-enabled="can-create-subtree"/> diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index 73bcd8ad..2edf6b38 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -99,6 +99,18 @@ var TreeStyleTabWindowHelper = { }; this.overrideExtensionsPreInit(); // windowHelperHacks.js + + + if ('MultipleTabService' in window && + Array.isArray(MultipleTabService.showHideMenuItemsConditionsProviders)) { + MultipleTabService.showHideMenuItemsConditionsProviders.push( + function treeProvider(aContextTabs) { + return { + 'can-create-subtree' : TreeStyleTabService.canCreateSubtree(aContextTabs) + }; + } + ); + } }, onBeforeBrowserInit : function TSTWH_onBeforeBrowserInit()