From 0f91030813ff30ea1e35337a85a298ca202b5962 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 1 Apr 2010 02:38:33 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=96=E3=83=83=E3=82=AF=E3=83=9E=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E4=B8=AD=E3=81=AB=E4=BF=9D=E5=AD=98=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=83=84=E3=83=AA=E3=83=BC=E6=A7=8B=E9=80=A0=E3=81=8C?= =?UTF-8?q?=E5=A3=8A=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E6=99=82=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E5=BE=A9=E5=87=A6=E7=90=86=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20=20*=20[A]=20(no=20parent)=20=20=20=20*=20[B]=20(parent=20is?= =?UTF-8?q?=20A)=20=20*=20[C]=20(parent=20is=20C=20itself)=20=20=20=20*=20?= =?UTF-8?q?[D]=20(parent=20is=20A)=20=20=20=20*=20[E]=20(parent=20is=20A)?= =?UTF-8?q?=20=E3=81=93=E3=81=AE=E3=82=88=E3=81=86=E3=81=AA=E7=8A=B6?= =?UTF-8?q?=E6=85=8B=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=81D,=20E?= =?UTF-8?q?=E3=81=AE=E8=A6=AA=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=87=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=B9=E3=81=8C-1=E3=82=88=E3=82=8A=E5=B0=8F?= =?UTF-8?q?=E3=81=95=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=82=92=E3=80=81C=E3=82=92A=E3=81=AE=E5=AD=90?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=83=84=E3=83=AA=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E7=B5=84=E3=81=BF=E8=BE=BC=E3=82=80=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= 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@6542 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/bookmarksOverlay.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index c083e808..881d7932 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -108,10 +108,12 @@ var TreeStyleTabBookmarksService = { if (aDefaultParentID === void(0)) aDefaultParentID = -1; + /* Get array of parents. The index becomes to -1, + if there is NO PARENT or the parent is THE TAB ITSELF. */ var treeStructure = aIDs.map(function(aId, aIndex) { let id = this.getParentItem(aId); let index = aIDs.indexOf(id); - return index > aIndex || index < -1 ? aDefaultParentID : index ; + return index >= aIndex ? aDefaultParentID : index ; }, this); /* Correct patterns like: @@ -147,7 +149,8 @@ var TreeStyleTabBookmarksService = { return aPosition - offset; }); - // smaller than -1 (-2, etc.) are invalid values. + /* The final step, this validates all of values. + Smaller than -1 is invalid, so it becomes to -1. */ return treeStructure.map(function(aIndex) { return aIndex < -1 ? aDefaultParentID : aIndex ; }, this);