зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1064217 - Fix closed window list for menu bar of hidden window on OS X r=gijs
This commit is contained in:
Родитель
98a6a6e1df
Коммит
396ccedd64
|
@ -504,12 +504,21 @@ function HistoryMenu(aPopupShowingEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
HistoryMenu.prototype = {
|
HistoryMenu.prototype = {
|
||||||
|
_getClosedTabCount() {
|
||||||
|
// SessionStore doesn't track the hidden window, so just return zero then.
|
||||||
|
if (window == Services.appShell.hiddenDOMWindow) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SessionStore.getClosedTabCount(window);
|
||||||
|
},
|
||||||
|
|
||||||
toggleRecentlyClosedTabs: function HM_toggleRecentlyClosedTabs() {
|
toggleRecentlyClosedTabs: function HM_toggleRecentlyClosedTabs() {
|
||||||
// enable/disable the Recently Closed Tabs sub menu
|
// enable/disable the Recently Closed Tabs sub menu
|
||||||
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
|
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
|
||||||
|
|
||||||
// no restorable tabs, so disable menu
|
// no restorable tabs, so disable menu
|
||||||
if (SessionStore.getClosedTabCount(window) == 0)
|
if (this._getClosedTabCount() == 0)
|
||||||
undoMenu.setAttribute("disabled", true);
|
undoMenu.setAttribute("disabled", true);
|
||||||
else
|
else
|
||||||
undoMenu.removeAttribute("disabled");
|
undoMenu.removeAttribute("disabled");
|
||||||
|
@ -527,7 +536,7 @@ HistoryMenu.prototype = {
|
||||||
undoPopup.removeChild(undoPopup.firstChild);
|
undoPopup.removeChild(undoPopup.firstChild);
|
||||||
|
|
||||||
// no restorable tabs, so make sure menu is disabled, and return
|
// no restorable tabs, so make sure menu is disabled, and return
|
||||||
if (SessionStore.getClosedTabCount(window) == 0) {
|
if (this._getClosedTabCount() == 0) {
|
||||||
undoMenu.setAttribute("disabled", true);
|
undoMenu.setAttribute("disabled", true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче