Bug 996632 - Close tab' option from the tab context menu should be active for the last tab. r=dao

This commit is contained in:
Praveenkumar 2014-04-17 03:26:00 +02:00
Родитель 4a4d624b6a
Коммит 19d6141301
2 изменённых файлов: 1 добавлений и 5 удалений

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

@ -6999,10 +6999,6 @@ var TabContextMenu = {
aPopupMenu.triggerNode : gBrowser.selectedTab;
let disabled = gBrowser.tabs.length == 1;
// Enable the "Close Tab" menuitem when the window doesn't close with the last tab.
document.getElementById("context_closeTab").disabled =
disabled && gBrowser.tabContainer._closeWindowWithLastTab;
var menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple");
for (let menuItem of menuItems)
menuItem.disabled = disabled;

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

@ -7,7 +7,7 @@ function test() {
let originalTab = gBrowser.tabs[0];
popup(originalTab);
ok(document.getElementById("context_closeTab").disabled, "The 'Close tab' menu item is disabled");
ok(!document.getElementById("context_closeTab").disabled, "The 'Close tab' menu item is enabled");
ok(document.getElementById("context_openTabInWindow").disabled, "The 'Move to New Window' menu item is disabled");
let newTabOne = gBrowser.addTab("about:blank", {skipAnimation: true});