新しい子をツリーの先頭に挿入する設定のときに、ブックマークから復元されたツリーが壊れていたのを修正
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4831 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
ca99a80342
commit
a6af6be4ed
@ -1370,14 +1370,14 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
this.initTab(tab);
|
this.initTab(tab);
|
||||||
|
|
||||||
var position = this.treeStructure && this.treeStructure.length ?
|
var hasStructure = this.treeStructure && this.treeStructure.length;
|
||||||
this.treeStructure.shift() : -1 ;
|
var positionInTree = hasStructure ? this.treeStructure.shift() : -1 ;
|
||||||
|
|
||||||
if (this.readyToAttachNewTab) {
|
if (this.readyToAttachNewTab) {
|
||||||
let parent = this.getTabById(this.parentTab);
|
let parent = this.getTabById(this.parentTab);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
let tabs = [parent].concat(this.getDescendantTabs(parent));
|
let tabs = [parent].concat(this.getDescendantTabs(parent));
|
||||||
parent = (position > -1 && position < tabs.length) ? tabs[position] : parent ;
|
parent = (positionInTree > -1 && positionInTree < tabs.length) ? tabs[positionInTree] : parent ;
|
||||||
}
|
}
|
||||||
if (parent) {
|
if (parent) {
|
||||||
this.attachTabTo(tab, parent);
|
this.attachTabTo(tab, parent);
|
||||||
@ -1385,7 +1385,9 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
let refTab;
|
let refTab;
|
||||||
let newIndex = -1;
|
let newIndex = -1;
|
||||||
if (this.insertBefore &&
|
if (hasStructure) {
|
||||||
|
}
|
||||||
|
else if (this.insertBefore &&
|
||||||
(refTab = this.getTabById(this.insertBefore))) {
|
(refTab = this.getTabById(this.insertBefore))) {
|
||||||
newIndex = refTab._tPos;
|
newIndex = refTab._tPos;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user