From 804d383ff2bfe617a23ce0da8b7dea6f864d81b4 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 6 May 2010 09:58:32 +0000 Subject: [PATCH] =?UTF-8?q?Library=E3=82=84=E3=83=96=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=83=9E=E3=83=BC=E3=82=AF=E3=81=AE=E3=83=97=E3=83=AD=E3=83=91?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=81=A7=E3=80=81=E3=83=84=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E8=A6=AA=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=8C=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E4=BA=8B=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=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@6660 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/bookmarksOverlay.js | 4 +++- content/treestyletab/bookmarksOverlayEditable.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index d42c3489..1ecc21bf 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -151,9 +151,11 @@ var TreeStyleTabBookmarksService = { /* The final step, this validates all of values. Smaller than -1 is invalid, so it becomes to -1. */ - return treeStructure.map(function(aIndex) { + treeStructure = treeStructure.map(function(aIndex) { return aIndex < -1 ? aDefaultParentID : aIndex ; }, this); + Application.console.log(treeStructure); + return treeStructure; }, // based on PlacesUtils.getURLsForContainerNode() diff --git a/content/treestyletab/bookmarksOverlayEditable.js b/content/treestyletab/bookmarksOverlayEditable.js index ef5d1743..6b060b51 100644 --- a/content/treestyletab/bookmarksOverlayEditable.js +++ b/content/treestyletab/bookmarksOverlayEditable.js @@ -147,7 +147,11 @@ var TreeStyleTabBookmarksServiceEditable = { var currentIndex = items.indexOf(aCurrentItem); var selected = treeStructure[currentIndex]; - if (selected > -1) selected = items[selected]; + if (selected > -1) { + let offset = treeStructure.lastIndexOf(-1, currentIndex); + let subStructure = treeStructure.slice(offset); + selected = items[selected + offset]; + } var fragment = document.createDocumentFragment(); items.forEach(function(aId, aIndex) {