[Pkg-mozext-commits] [tabmixplus] 106/123: Set our 'Auto Reload' context menu on all button with command to reload or stop, this patch will add our context menu to button added by Classic Theme Restorer

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:32 UTC 2014


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 8ec0ce5b73ca78473930797e018b1e13a00c6e41
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Sep 14 17:29:57 2014 +0300

    Set our 'Auto Reload' context menu on all button with command to reload or stop, this patch will add our context menu to button added by Classic Theme Restorer
---
 chrome/content/tab/tab.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index f70264b..1de34e9 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1516,16 +1516,18 @@ var gTMPprefObserver = {
   // Show Reload Every menu on Reload button
   showReloadEveryOnReloadButton: function() {
     let show = Tabmix.prefs.getBoolPref("reloadEvery.onReloadButton");
-    let reloadButton = document.getElementById("reload-button");
-    if (reloadButton) {
-      Tabmix.setItem(reloadButton, "type", show ? "menu-button" : null);
-      Tabmix.setItem(reloadButton, "context", show ? "autoreload_popup" : null);
-      Tabmix.setItem("stop-button", "context", show ? "autoreload_popup" : null);
-    }
-
+    Tabmix.setItem("reload-button", "type", show ? "menu-button" : null);
     Tabmix.setItem("urlbar-go-button", "context", show ? "autoreload_popup" : null);
-    Tabmix.setItem("urlbar-reload-button", "context", show ? "autoreload_popup" : null);
-    Tabmix.setItem("urlbar-stop-button", "context", show ? "autoreload_popup" : null);
+
+    let setContext = function(command) {
+      let items = document.getElementsByAttribute("command" ,"Browser:" + command);
+      Array.slice(items).forEach(function(item) {
+        if (item.localName == "toolbarbutton")
+          Tabmix.setItem(item, "context", show ? "autoreload_popup" : null);
+      });
+    }
+    setContext("ReloadOrDuplicate");
+    setContext("Stop");
   },
 
   // we replace some Tabmix settings with Firefox settings

-- 
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