From a6af6be4edaea4476d87b04ff7a44acd567d4e81 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 30 Jul 2009 08:57:42 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=84=E5=AD=90=E3=82=92?= =?UTF-8?q?=E3=83=84=E3=83=AA=E3=83=BC=E3=81=AE=E5=85=88=E9=A0=AD=E3=81=AB?= =?UTF-8?q?=E6=8C=BF=E5=85=A5=E3=81=99=E3=82=8B=E8=A8=AD=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=AB=E3=80=81=E3=83=96=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=83=9E=E3=83=BC=E3=82=AF=E3=81=8B=E3=82=89=E5=BE=A9=E5=85=83?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=83=84=E3=83=AA=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E5=A3=8A=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4831 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 0f2d2b1b..01b6c368 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1370,14 +1370,14 @@ TreeStyleTabBrowser.prototype = { this.initTab(tab); - var position = this.treeStructure && this.treeStructure.length ? - this.treeStructure.shift() : -1 ; + var hasStructure = this.treeStructure && this.treeStructure.length; + var positionInTree = hasStructure ? this.treeStructure.shift() : -1 ; if (this.readyToAttachNewTab) { let parent = this.getTabById(this.parentTab); if (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) { this.attachTabTo(tab, parent); @@ -1385,7 +1385,9 @@ TreeStyleTabBrowser.prototype = { let refTab; let newIndex = -1; - if (this.insertBefore && + if (hasStructure) { + } + else if (this.insertBefore && (refTab = this.getTabById(this.insertBefore))) { newIndex = refTab._tPos; }