From cdb0ad6a4e6144b1258ee841b6305f82ffa549c0 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 30 Jul 2009 17:36:02 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A6=AA=E3=82=BF=E3=83=96=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E7=94=A8=E3=83=AA=E3=82=B9=E3=83=88=E3=82=92=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=83=B3=E3=83=88=E8=A1=A8=E7=A4=BA?= 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@4841 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/bookmarksOverlay.js | 8 +------ content/treestyletab/editBookmarkOverlay.js | 25 +++++++++++++-------- content/treestyletab/treestyletab.js | 13 ++++++++++- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index 5f77a471..fbce8bb1 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -16,13 +16,7 @@ window.addEventListener('load', function() { = siblings.indexOf(current)) break; + nest++; + current = parent; + } + if (nest) item.setAttribute('style', 'padding-left:'+nest+'em'); + if (!afterCurrent && aId == id) afterCurrent = true; if (afterCurrent) item.setAttribute('disabled', true); + fragment.appendChild(item); }); range.insertNode(fragment); range.detach(); - var annotations = PlacesUtils.getAnnotationsForItem(id); - var parent = -1; - for (let i in annotations) - { - if (annotations[i].name != TreeStyleTabService.kPARENT) continue; - parent = parseInt(annotations[i].value); - break; - } - var index = siblings.indexOf(parent); var current = siblings.indexOf(id); if (index < 0 || index >= current) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 75072864..922362cb 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -2595,8 +2595,19 @@ catch(e) { this._addingBookmarkTreeStructure = []; }, + getParentItemForBookmark : function(aId) + { + var annotations = PlacesUtils.getAnnotationsForItem(aId); + for (let i in annotations) + { + if (annotations[i].name != this.kPARENT) continue; + return parseInt(annotations[i].value); + } + return -1; + }, + // based on PlacesUtils.getURLsForContainerNode() - getItemIdsForContainerNode: function(aNode) + getItemIdsForContainerNode : function(aNode) { var ids = []; if (!PlacesUtils.nodeIsContainer(aNode)) return ids;