Bug 544833 - Prevent Ctrl+Shift+Tab from triggering Show All Tabs if browser.ctrlTab.previews is false. r=dao
authorCameron McCormack <cam@mcc.id.au>
Mon, 29 Nov 2010 15:02:36 +1300
changeset 58768 a8c06e21635d5d58d147bb23a971639e7e655dce
parent 58767 84fe21efcb57b212f07d8a14d801712dd773b7f0
child 58769 23aa5649204e52380945e9761843751a092cd2dd
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersdao
bugs544833
milestone2.0b8pre
Bug 544833 - Prevent Ctrl+Shift+Tab from triggering Show All Tabs if browser.ctrlTab.previews is false. r=dao
browser/base/content/browser-tabPreviews.js
--- a/browser/base/content/browser-tabPreviews.js
+++ b/browser/base/content/browser-tabPreviews.js
@@ -559,16 +559,24 @@ var ctrlTab = {
     tabContainer[toggleEventListener]("TabClose", this, false);
 
     document[toggleEventListener]("keypress", this, false);
     gBrowser.mTabBox.handleCtrlTab = !enable;
 
     // If we're not running, hide the "Show All Tabs" menu item,
     // as Shift+Ctrl+Tab will be handled by the tab bar.
     document.getElementById("menu_showAllTabs").hidden = !enable;
+
+    // Also disable the <key> to ensure Shift+Ctrl+Tab never triggers
+    // Show All Tabs.
+    var key_showAllTabs = document.getElementById("key_showAllTabs");
+    if (enable)
+      key_showAllTabs.removeAttribute("disabled");
+    else
+      key_showAllTabs.setAttribute("disabled", "true");
   }
 };
 
 
 /**
  * All Tabs panel
  */
 var allTabs = {
@@ -623,22 +631,23 @@ var allTabs = {
     this._initiated = false;
   },
 
   prefName: "browser.allTabs.previews",
   readPref: function allTabs_readPref() {
     var allTabsButton = document.getElementById("alltabs-button");
     if (!allTabsButton)
       return;
-    if (gPrefService.getBoolPref(this.prefName)) {
-      allTabsButton.removeAttribute("type");
+
+    if (gPrefService.getBoolPref(this.prefName)) {
+      allTabsButton.removeAttribute("type");
       allTabsButton.setAttribute("command", "Browser:ShowAllTabs");
-    } else {
-      allTabsButton.setAttribute("type", "menu");
-      allTabsButton.removeAttribute("command");
+    } else {
+      allTabsButton.setAttribute("type", "menu");
+      allTabsButton.removeAttribute("command");
       allTabsButton.removeAttribute("oncommand");
     }
   },
   observe: function (aSubject, aTopic, aPrefName) {
     this.readPref();
   },
 
   pick: function allTabs_pick(aPreview) {