mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 14:15:30 +00:00
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:
parent
da53348c70
commit
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
|
||||
|
Loading…
Reference in New Issue
Block a user