現在のタブより下の階層だけを選択不可に

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4933 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-08-11 05:48:19 +00:00
parent e79d7f5c65
commit fa23a2cbae
3 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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);

View File

@ -1,5 +1,4 @@
<?xml version="1.0"?>
<?xul-overlay href="bookmarksOverlay.xul"?>
<?xml-stylesheet href="bookmarksOverlayEditable.css" type="text/css"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="bookmarksOverlayEditable.js" type="application/x-javascript; version=1.7"/>