[Pkg-mozext-commits] [tabmixplus] 24/26: Missing label in 'Tab Mix' options on Firefox 45 with TabGroups extension. Check for 'context_tabViewMenu' and 'tabGroups-context_tabViewMenu' existence

David Prévot taffit at moszumanska.debian.org
Fri Mar 25 21:56:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag 0.4.2.3pre.160319a1
in repository tabmixplus.

commit beb1eb7ae0e5131b2c19ef43b2eb012782d1e92b
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Mar 18 12:05:18 2016 +0200

    Missing label in 'Tab Mix' options on Firefox 45 with TabGroups extension. Check for 'context_tabViewMenu' and 'tabGroups-context_tabViewMenu' existence
---
 chrome/content/click/click.js             |  7 ++++++-
 chrome/content/overlay/tabContextMenu.xul |  2 ++
 chrome/content/preferences/menu.js        | 13 ++++++++-----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index f90facd..8e56036 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -443,7 +443,12 @@ var TabmixContext = {
     var show = Tabmix.prefs.getBoolPref("pinTabMenu");
     Tabmix.showItem("context_pinTab", show && !aTab.pinned);
     Tabmix.showItem("context_unpinTab", show && aTab.pinned);
-    Tabmix.showItem("context_tabViewMenu", Tabmix.prefs.getBoolPref("moveToGroup") && !aTab.pinned);
+    setTimeout(() => {
+      // we need to set our show/hide after tabGroups extension
+      let tabViewMenu = document.getElementById("context_tabViewMenu") ||
+          document.getElementById("tabGroups-context_tabViewMenu");
+      Tabmix.showItem(tabViewMenu, Tabmix.prefs.getBoolPref("moveToGroup") && !aTab.pinned);
+    });
     Tabmix.showItem("tm-mergeWindowsTab",
                     Tabmix.prefs.getBoolPref("showMergeWindow") &&
                     (!Tabmix.singleWindowMode ||
diff --git a/chrome/content/overlay/tabContextMenu.xul b/chrome/content/overlay/tabContextMenu.xul
index 42a4a94..81eb87e 100644
--- a/chrome/content/overlay/tabContextMenu.xul
+++ b/chrome/content/overlay/tabContextMenu.xul
@@ -29,6 +29,8 @@
         <menuitem id="context_pinTab">
         <menuitem id="context_unpinTab"/>
         <menuitem id="context_tabViewMenu"/>
+     or
+        <menuitem id="tabGroups-context_tabViewMenu"/>
 -->
         <menuitem id="tm-mergeWindowsTab" insertbefore="context_openTabInWindow"
                  key="key_tm_mergeWin" label="&mergeContext.label;" accesskey="&mergeContext.accesskey;"
diff --git a/chrome/content/preferences/menu.js b/chrome/content/preferences/menu.js
index 4c92045..523693b 100644
--- a/chrome/content/preferences/menu.js
+++ b/chrome/content/preferences/menu.js
@@ -8,6 +8,8 @@ var gMenuPane = { // jshint ignore:line
     $("clearClosedTabs").setAttribute("label", TabmixSvc.getString("undoclosetab.clear.label"));
 
     var browserWindow = Tabmix.getTopWin();
+    let $$ = id => browserWindow.document.getElementById(id);
+
     if (Tabmix.isVersion(430)) {
       $("muteTab").label = browserWindow.gNavigatorBundle.getString("muteTab.label") + "/" +
         browserWindow.gNavigatorBundle.getString("unmuteTab.label");
@@ -16,16 +18,17 @@ var gMenuPane = { // jshint ignore:line
     }
 
     // if Tabview exist copy its menu label
-    if (browserWindow.TMP_TabView.installed) {
-      let label = browserWindow.document.getElementById("context_tabViewMenu").getAttribute("label");
-      $("moveToGroup").label = label;
+    let tabViewMenu = browserWindow.TMP_TabView.installed &&
+        ($$("context_tabViewMenu") || $$("tabGroups-context_tabViewMenu"));
+    if (tabViewMenu) {
+      $("moveToGroup").label = tabViewMenu.getAttribute("label");
     } else {
       gPrefWindow.removeChild("pref_showMoveToGroup");
       gPrefWindow.removeChild("moveToGroup");
     }
 
     if (Tabmix.isVersion(320)) {
-      let openNonRemote = browserWindow.document.getElementById("context_openNonRemoteWindow");
+      let openNonRemote = $$("context_openNonRemoteWindow");
       if (openNonRemote) {
         let item = $("openNonRemoteWindow");
         item.setAttribute("label", openNonRemote.getAttribute("label"));
@@ -38,7 +41,7 @@ var gMenuPane = { // jshint ignore:line
     }
 
     // check if bookmark item in tab context menu
-    Tabmix.setItem("bmMenu", "hidden", !(browserWindow.document.getElementById("context_bookmarkAllTabs")));
+    Tabmix.setItem("bmMenu", "hidden", !($$("context_bookmarkAllTabs")));
 
     this.setInverseLinkLabel();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list