Bug 1064217 - Fix closed window list for menu bar of hidden window on OS X r=gijs

This commit is contained in:
Tim Taubert 2014-09-08 14:25:05 +02:00
Родитель 98a6a6e1df
Коммит 396ccedd64
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -504,12 +504,21 @@ function HistoryMenu(aPopupShowingEvent) {
}
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() {
// enable/disable the Recently Closed Tabs sub menu
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
// no restorable tabs, so disable menu
if (SessionStore.getClosedTabCount(window) == 0)
if (this._getClosedTabCount() == 0)
undoMenu.setAttribute("disabled", true);
else
undoMenu.removeAttribute("disabled");
@ -527,7 +536,7 @@ HistoryMenu.prototype = {
undoPopup.removeChild(undoPopup.firstChild);
// no restorable tabs, so make sure menu is disabled, and return
if (SessionStore.getClosedTabCount(window) == 0) {
if (this._getClosedTabCount() == 0) {
undoMenu.setAttribute("disabled", true);
return;
}