mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 604457 - switchToTabHavingURI shouldn't close selected tab or revert URL bar. r+a=gavin
This commit is contained in:
parent
de74f3f780
commit
3f18ac84a9
@ -7845,17 +7845,11 @@ function switchToTabHavingURI(aURI, aOpenNew, aCallback) {
|
||||
for (let i = 0; i < browsers.length; i++) {
|
||||
let browser = browsers[i];
|
||||
if (browser.currentURI.equals(aURI)) {
|
||||
gURLBar.handleRevert();
|
||||
// We need the current tab so we can check if we should close it
|
||||
let prevTab = gBrowser.selectedTab;
|
||||
// Focus the matching window & tab
|
||||
aWindow.focus();
|
||||
aWindow.gBrowser.tabContainer.selectedIndex = i;
|
||||
if (aCallback)
|
||||
aCallback(browser);
|
||||
// Close the previously selected tab if it was empty
|
||||
if (isTabEmpty(prevTab))
|
||||
gBrowser.removeTab(prevTab);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -248,8 +248,13 @@
|
||||
if (action) {
|
||||
url = action.param;
|
||||
if (!(aTriggeringEvent && aTriggeringEvent.altKey)) {
|
||||
if (action.type == "switchtab")
|
||||
switchToTabHavingURI(url);
|
||||
if (action.type == "switchtab") {
|
||||
this.handleRevert();
|
||||
let prevTab = gBrowser.selectedTab;
|
||||
if (switchToTabHavingURI(url) &&
|
||||
isTabEmpty(prevTab))
|
||||
gBrowser.removeTab(prevTab);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user