タブを開き直すときのための属性値はすべて最後にまとめて設定するようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4148 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-04-20 12:48:34 +00:00
parent b865f7bf7d
commit df47c50ca2

View File

@ -1431,9 +1431,9 @@ TreeStyleTabBrowser.prototype = {
if (next)
this.setTabValue(tab, this.kINSERT_BEFORE, next.getAttribute(this.kID));
var backupChildren;
var backupAttributes = {};
if (firstChild) {
backupChildren = this.getTabValue(tab, this.kCHILDREN);
backupAttributes[this.kCHILDREN] = this.getTabValue(tab, this.kCHILDREN);
let children = this.getChildTabs(tab);
children.forEach((
closeParentBehavior == this.CLOSE_PARENT_BEHAVIOR_DETACH ?
@ -1476,10 +1476,10 @@ TreeStyleTabBrowser.prototype = {
do {
ancestors.push(parentTab.getAttribute(this.kID));
if (!next && (next = this.getNextSiblingTab(parentTab)))
this.setTabValue(tab, this.kINSERT_BEFORE, next.getAttribute(this.kID));
backupAttributes[this.kINSERT_BEFORE] = next.getAttribute(this.kID);
}
while (parentTab = this.getParentTab(parentTab));
this.setTabValue(tab, this.kANCESTOR, ancestors.join('|'));
backupAttributes[this.kANCESTOR] = ancestors.join('|');
this.partTab(tab, true);
}
@ -1500,7 +1500,10 @@ TreeStyleTabBrowser.prototype = {
this.showTabbarForFeedback();
if (backupChildren) this.setTabValue(tab, this.kCHILDREN, backupChildren);
for (var i in backupAttributes)
{
this.setTabValue(tab, i, backupAttributes[i]);
}
},
CLOSE_PARENT_BEHAVIOR_ATTACH : 0,
CLOSE_PARENT_BEHAVIOR_DETACH : 1,