Bug 344140 - 'Recently closed tabs' entries not middle-clickable. patch from Michael Ventnor <ventnor.bugzilla@yahoo.com.au>, r=me.

This commit is contained in:
mozilla.mano%sent.com 2006-10-20 16:26:53 +00:00
Родитель da53348c70
Коммит 7b361e07da
1 изменённых файлов: 15 добавлений и 0 удалений

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

@ -6843,6 +6843,7 @@ HistoryMenu.populateUndoSubmenu = function PHM_populateUndoSubmenu() {
m.setAttribute("label", undoItems[i].title);
m.setAttribute("value", i);
m.setAttribute("oncommand", "undoCloseTab(" + i + ");");
m.addEventListener("click", undoCloseMiddleClick, false);
}
// "open in tabs"
@ -6857,6 +6858,20 @@ HistoryMenu.populateUndoSubmenu = function PHM_populateUndoSubmenu() {
}, false);
}
/**
* Re-open a closed tab and put it to the end of the tab strip.
* Used for a middle click.
* @param aEvent
* The event when the user clicks the menu item
*/
function undoCloseMiddleClick(aEvent) {
if (aEvent.button != 1)
return;
undoCloseTab(aEvent.originalTarget.value);
getBrowser().moveTabToEnd();
}
/**
* Re-open a closed tab.
* @param aIndex