"fast restore" should restore collapsed/expand state based on user pref
This commit is contained in:
parent
acefddccb7
commit
5193c60a3b
@ -2304,14 +2304,17 @@ TreeStyleTabBrowser.prototype = {
|
||||
var subTreeCollapsed = this.getTabValue(aTab, this.kSUBTREE_COLLAPSED) == 'true';
|
||||
var children = this.getTabValue(aTab, this.kCHILDREN);
|
||||
if (children) {
|
||||
subTreeCollapsed = this._restoreSubtreeCollapsedState(aTab, subTreeCollapsed);
|
||||
children.split('|').forEach(function(aChild) {
|
||||
aChild = this.getTabById(aChild);
|
||||
if (aChild)
|
||||
if (aChild) {
|
||||
this.attachTabTo(aChild, aTab, {
|
||||
forceExpand : true, // to prevent to collapse the selected tab
|
||||
dontAnimate : true,
|
||||
insertBefore : this.getTabById(this.getTabValue(aChild, this.kINSERT_BEFORE))
|
||||
});
|
||||
this.collapseExpandTab(aChild, subTreeCollapsed, true);
|
||||
}
|
||||
}, this);
|
||||
this.collapseExpandSubtree(aTab, subTreeCollapsed, true);
|
||||
}
|
||||
@ -3315,14 +3318,18 @@ TreeStyleTabBrowser.prototype = {
|
||||
this.deleteTabValue(aTab, this.kCLOSED_SET_ID);
|
||||
return closeSetId;
|
||||
},
|
||||
_restoreSubtreeCollapsedState : function TSTBrowser_restoreSubtreeCollapsedState(aTab)
|
||||
_restoreSubtreeCollapsedState : function TSTBrowser_restoreSubtreeCollapsedState(aTab, aCollapsed)
|
||||
{
|
||||
var shouldCollapse = this.getTreePref('collapseExpandSubtree.sessionRestore');
|
||||
|
||||
if (aCollapsed === void(0))
|
||||
aCollapsed = this.getTabValue(aTab, this.kSUBTREE_COLLAPSED) == 'true';
|
||||
|
||||
var isSubtreeCollapsed = (
|
||||
this.windowService.restoringTree &&
|
||||
(
|
||||
shouldCollapse == this.RESTORED_TREE_COLLAPSED_STATE_LAST_STATE ?
|
||||
(this.getTabValue(aTab, this.kSUBTREE_COLLAPSED) == 'true') :
|
||||
aCollapsed :
|
||||
shouldCollapse == this.RESTORED_TREE_COLLAPSED_STATE_COLLAPSED
|
||||
)
|
||||
);
|
||||
|
@ -1598,7 +1598,7 @@ TreeStyleTabWindow.prototype = {
|
||||
}
|
||||
},
|
||||
get restoringTree() {
|
||||
return this.restoringCount > 0;
|
||||
return this.restoringCount || this.window.__SS_tabsToRestore;
|
||||
},
|
||||
|
||||
/* Pref Listener */
|
||||
|
Loading…
x
Reference in New Issue
Block a user