Bug 684773 - Unpin all tabs earlier when restoring a session in overwriting mode; r=dietrich

This commit is contained in:
ithinc 2011-09-22 17:35:25 +01:00
parent 28beac255b
commit 205944c60f

View File

@ -2601,17 +2601,17 @@ SessionStoreService.prototype = {
var smoothScroll = tabstrip.smoothScroll;
tabstrip.smoothScroll = false;
// make sure that the selected tab won't be closed in order to
// prevent unnecessary flickering
if (aOverwriteTabs && tabbrowser.selectedTab._tPos >= newTabCount)
tabbrowser.moveTabTo(tabbrowser.selectedTab, newTabCount - 1);
// unpin all tabs to ensure they are not reordered in the next loop
if (aOverwriteTabs) {
for (let t = tabbrowser._numPinnedTabs - 1; t > -1; t--)
tabbrowser.unpinTab(tabbrowser.tabs[t]);
}
// make sure that the selected tab won't be closed in order to
// prevent unnecessary flickering
if (aOverwriteTabs && tabbrowser.selectedTab._tPos >= newTabCount)
tabbrowser.moveTabTo(tabbrowser.selectedTab, newTabCount - 1);
for (var t = 0; t < newTabCount; t++) {
tabs.push(t < openTabCount ?
tabbrowser.tabs[t] :