Bug 1473974 - Fix opening all tabs panel with cycle recent tabs r=dao

MozReview-Commit-ID: EGYJo8AAF2K
This commit is contained in:
Mark Striemer
2018-07-10 13:48:57 -05:00
parent 63df8acae1
commit fd7bcb67b4
3 changed files with 18 additions and 28 deletions

View File

@@ -294,7 +294,7 @@ var ctrlTab = {
var showAllLabel = gNavigatorBundle.getString("ctrlTab.listAllTabs.label");
this.showAllButton._label.setAttribute("value",
PluralForm.get(this.tabCount, showAllLabel).replace("#1", this.tabCount));
this.showAllButton.hidden = !allTabs.canOpen;
this.showAllButton.hidden = !gTabsPanel.canOpen;
},
updatePreview: function ctrlTab_updatePreview(aPreview, aTab) {
@@ -570,7 +570,7 @@ var ctrlTab = {
break;
case "popupshowing":
if (event.target.id == "menu_viewPopup")
document.getElementById("menu_showAllTabs").hidden = !allTabs.canOpen;
document.getElementById("menu_showAllTabs").hidden = !gTabsPanel.canOpen;
break;
}
},
@@ -628,27 +628,3 @@ var ctrlTab = {
key_showAllTabs.setAttribute("disabled", "true");
}
};
/**
* All Tabs menu
*/
var allTabs = {
get toolbarButton() {
return document.getElementById("alltabs-button");
},
get canOpen() {
return isElementVisible(this.toolbarButton);
},
open: function allTabs_open() {
if (this.canOpen) {
// Without setTimeout, the menupopup won't stay open when invoking
// "View > Show All Tabs" and the menu bar auto-hides.
setTimeout(() => {
this.toolbarButton.open = true;
}, 0);
}
}
};