Bug 958166 - Fix error saving tabs from other groups to session store [r=emtwo]

This commit is contained in:
Matt Brubeck 2014-01-09 12:13:12 -08:00
Родитель 821accba8f
Коммит ef75a67658
1 изменённых файлов: 8 добавлений и 9 удалений

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

@ -539,16 +539,16 @@ SessionStore.prototype = {
aBrowser.__SS_data = tabData;
},
_saveTabData: function(aTabList, aWinData) {
for (let tab of aTabList) {
_getTabData: function(aWindow) {
return aWindow.Browser.tabs.map(tab => {
let browser = tab.browser;
if (browser.__SS_data) {
let tabData = browser.__SS_data;
if (browser.__SS_extdata)
tabData.extData = browser.__SS_extdata;
aWinData.tabs.push(tabData);
return tabData;
}
}
});
},
_collectWindowData: function ss__collectWindowData(aWindow) {
@ -557,14 +557,12 @@ SessionStore.prototype = {
return;
let winData = this._windows[aWindow.__SSID];
winData.tabs = [];
let index = aWindow.Elements.browsers.selectedIndex;
winData.selected = parseInt(index) + 1; // 1-based
let tabs = aWindow.Browser.tabs;
this._saveTabData(tabs, winData);
this._saveTabData(this._tabsFromOtherGroups, winData);
let tabData = this._getTabData(aWindow);
winData.tabs = tabData.concat(this._tabsFromOtherGroups);
},
_forEachBrowserWindow: function ss_forEachBrowserWindow(aFunc) {
@ -793,8 +791,9 @@ SessionStore.prototype = {
this._windows[SSID] = data.windows[i];
} else {
SSID = window.__SSID;
this._windows[SSID].extData = data.windows[i].extData;
this._windows[SSID]._closedTabs =
this._windows[SSID]._closedTabs.concat(data.windows[windowIndex]._closedTabs);
this._windows[SSID]._closedTabs.concat(data.windows[i]._closedTabs);
}
this._orderedWindows.push(SSID);
}