Update cached "toBeRestored" state for TSTWindow#restoringTree and others

This commit is contained in:
YUKI Hiroshi 2014-09-30 17:06:49 +09:00
parent b7389dd744
commit db4d2bac2c

View File

@ -6626,8 +6626,12 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
var onlyVisible = level <= this.kRESTORE_TREE_ONLY_VISIBLE;
tabs = tabs.filter(function(aTab) {
var toBeRestored = utils.isTabNotRestoredYet(aTab);
// This cache can be set to false by initTab(), but now we not the correct status.
// Because this cached status is used by other methods, we must update it now.
aTab.linkedBrowser.__treestyletab__toBeRestored = toBeRestored;
return (
utils.isTabNotRestoredYet(aTab) &&
toBeRestored &&
(!onlyVisible || !aTab.hidden)
);
});