Libraryやブックマークのプロパティで、ツリーの親の変更が保存されない事があったのを修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6660 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-05-06 09:58:32 +00:00
parent 3607ac93a0
commit 804d383ff2
2 changed files with 8 additions and 2 deletions

View File

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

View File

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