Bug 578711 - Opening two copies of 'Tabs from my Other Computers' closes Fennec [r=vingtetun]

This commit is contained in:
Mark Finkle 2010-07-16 11:48:53 -04:00
Родитель 40de679741
Коммит ab02cbfb32
2 изменённых файлов: 12 добавлений и 5 удалений

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

@ -587,6 +587,17 @@ var BrowserUI = {
return tab; return tab;
}, },
newOrSelectTab: function newOrSelectTab(aURI, aOwner) {
let tabs = Browser.tabs;
for (let i = 0; i < tabs.length; i++) {
if (tabs[i].browser.currentURI.spec == aURI) {
Browser.selectedTab = tabs[i];
return;
}
}
this.newTab(aURI, aOwner);
},
closeTab : function closeTab(aTab) { closeTab : function closeTab(aTab) {
// If no tab is passed in, assume the current tab // If no tab is passed in, assume the current tab
Browser.closeTab(aTab || Browser.selectedTab); Browser.closeTab(aTab || Browser.selectedTab);

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

@ -48,7 +48,7 @@ let WeaveGlue = {
}, },
openRemoteTabs: function openRemoteTabs() { openRemoteTabs: function openRemoteTabs() {
this._openTab("about:sync-tabs"); BrowserUI.newOrSelectTab("about:sync-tabs", null);
}, },
connect: function connect() { connect: function connect() {
@ -80,10 +80,6 @@ let WeaveGlue = {
addEventListener("unload", function() addRem(false), false); addEventListener("unload", function() addRem(false), false);
}, },
_openTab: function _openTab(url) {
setTimeout(function() BrowserUI.newTab(url), 0);
},
get _settings() { get _settings() {
// Do a quick test to see if the options exist yet // Do a quick test to see if the options exist yet
let syncButton = document.getElementById("sync-syncButton"); let syncButton = document.getElementById("sync-syncButton");