From fa23a2cbaee702da22fedf673fb086694f4c9692 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 11 Aug 2009 05:48:19 +0000 Subject: [PATCH] =?UTF-8?q?=E7=8F=BE=E5=9C=A8=E3=81=AE=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=82=88=E3=82=8A=E4=B8=8B=E3=81=AE=E9=9A=8E=E5=B1=A4=E3=81=A0?= =?UTF-8?q?=E3=81=91=E3=82=92=E9=81=B8=E6=8A=9E=E4=B8=8D=E5=8F=AF=E3=81=AB?= 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@4933 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- chrome.manifest | 3 ++- content/treestyletab/bookmarksOverlayEditable.js | 8 +++++--- content/treestyletab/bookmarksOverlayEditable.xul | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/chrome.manifest b/chrome.manifest index 4669c773..8bc71e9d 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -4,8 +4,9 @@ overlay chrome://browser/content/browser.xul chrome://treestyletab/content/trees overlay chrome://browser/content/bookmarks/bookmarksPanel.xul chrome://treestyletab/content/bookmarksOverlay.xul overlay chrome://browser/content/history/history-panel.xul chrome://treestyletab/content/bookmarksOverlay.xul - +overlay chrome://browser/content/places/places.xul chrome://treestyletab/content/bookmarksOverlay.xul overlay chrome://browser/content/places/places.xul chrome://treestyletab/content/bookmarksOverlayEditable.xul +overlay chrome://browser/content/places/bookmarkProperties.xul chrome://treestyletab/content/bookmarksOverlay.xul overlay chrome://browser/content/places/bookmarkProperties.xul chrome://treestyletab/content/bookmarksOverlayEditable.xul overlay chrome://multipletab/content/config.xul chrome://treestyletab/content/multipletabConfigOverlay.xul diff --git a/content/treestyletab/bookmarksOverlayEditable.js b/content/treestyletab/bookmarksOverlayEditable.js index b14de84f..10144494 100644 --- a/content/treestyletab/bookmarksOverlayEditable.js +++ b/content/treestyletab/bookmarksOverlayEditable.js @@ -129,7 +129,8 @@ var TreeStyleEditableBookmarkService = { var items = this._getItemsInFolder(PlacesUtils.bookmarks.getFolderIdForItem(aCurrentItem)); var treeStructure = TreeStyleTabBookmarksService.getTreeStructureFromItems(items); - var selected = treeStructure[items.indexOf(aCurrentItem)]; + var currentIndex = items.indexOf(aCurrentItem); + var selected = treeStructure[currentIndex]; if (selected > -1) selected = items[selected]; var fragment = document.createDocumentFragment(); @@ -141,14 +142,15 @@ var TreeStyleEditableBookmarkService = { let parent = aIndex; let nest = 0; + let disabled = false; while ((parent = treeStructure[parent]) != -1) { nest++; + if (parent == currentIndex) disabled = true; } if (nest) item.setAttribute('style', 'padding-left:'+nest+'em'); - if (aId == aCurrentItem) afterCurrent = true; - if (afterCurrent) item.setAttribute('disabled', true); + if (disabled || aId == aCurrentItem) item.setAttribute('disabled', true); if (aId == selected && !afterCurrent) item.setAttribute('selected', true); fragment.appendChild(item); diff --git a/content/treestyletab/bookmarksOverlayEditable.xul b/content/treestyletab/bookmarksOverlayEditable.xul index 17f7484f..7c55300f 100644 --- a/content/treestyletab/bookmarksOverlayEditable.xul +++ b/content/treestyletab/bookmarksOverlayEditable.xul @@ -1,5 +1,4 @@ -