From b6f36402c3888a108854185438c9fb849a47d6a2 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 21 Jun 2016 17:00:05 +0900 Subject: [PATCH] Update codes for new Multiple Tab Handler --- content/treestyletab/treestyletab.xul | 4 ++-- content/treestyletab/windowHelper.js | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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()