セッション復元時にツリーが壊れることがあったのを修正
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1615 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
905dd6369f
commit
dd18b16982
@ -1106,13 +1106,22 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
id += 'd';
|
id += 'd';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If it has a parent, it is wrongly attacched by tab moving
|
if (!isDuplicated) {
|
||||||
on restoring. Restoring the old ID (the next statement)
|
/* If it has a parent, it is wrongly attacched by tab moving
|
||||||
breaks the children list of the temporary parent and causes
|
on restoring. Restoring the old ID (the next statement)
|
||||||
many problems. So, to prevent these problems, I part the tab
|
breaks the children list of the temporary parent and causes
|
||||||
from the temporary parent manually. */
|
many problems. So, to prevent these problems, I part the tab
|
||||||
if (!isDuplicated && this.getParentTab(tab))
|
from the temporary parent manually. */
|
||||||
this.partTab(tab);
|
this.partTab(tab);
|
||||||
|
/* reset attributes before restoring */
|
||||||
|
tab.removeAttribute(this.kID);
|
||||||
|
tab.removeAttribute(this.kPARENT);
|
||||||
|
tab.removeAttribute(this.kCHILDREN);
|
||||||
|
tab.removeAttribute(this.kSUBTREE_COLLAPSED);
|
||||||
|
tab.removeAttribute(this.kCOLLAPSED);
|
||||||
|
tab.removeAttribute(this.kNEST);
|
||||||
|
this.updateTabsIndent([tab]);
|
||||||
|
}
|
||||||
|
|
||||||
this.setTabValue(tab, this.kID, id);
|
this.setTabValue(tab, this.kID, id);
|
||||||
|
|
||||||
@ -1161,7 +1170,9 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
if (!parent && (before = this.getTabById(before))) {
|
if (!parent && (before = this.getTabById(before))) {
|
||||||
var index = before._tPos;
|
var index = before._tPos;
|
||||||
if (index > tab._tPos) index--;
|
if (index > tab._tPos) index--;
|
||||||
|
// b.treeStyleTab.internallyTabMoving = true;
|
||||||
b.moveTabTo(tab, index);
|
b.moveTabTo(tab, index);
|
||||||
|
// b.treeStyleTab.internallyTabMoving = false;
|
||||||
}
|
}
|
||||||
this.deleteTabValue(tab, this.kINSERT_BEFORE);
|
this.deleteTabValue(tab, this.kINSERT_BEFORE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user