зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
da53348c70
Коммит
7b361e07da
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче