nested tree with folders couldn't be saved correctly

This commit is contained in:
Piro / SHIMODA Hiroshi 2012-01-28 06:07:55 +09:00
parent 055d7c3893
commit 71cfcd3601

View File

@ -74,10 +74,12 @@ var TreeStyleTabBookmarksService = {
let index = aTreeStructure[aIndex]; let index = aTreeStructure[aIndex];
let parent = index > -1 ? aBookarmks[index] : null ; let parent = index > -1 ? aBookarmks[index] : null ;
if (parent && parent.isFolder) { if (parent && (parent.folder || parent).isFolder) {
this.BookmarksService.moveItem(aItem.id, parent.id, -1); let folder = parent.folder || parent;
this.BookmarksService.moveItem(aItem.id, folder.id, -1);
aItem.folder = folder;
} }
else { if (parent && !parent.isFolder) {
PlacesUtils.setAnnotationsForItem(aItem.id, [{ PlacesUtils.setAnnotationsForItem(aItem.id, [{
name : this.kPARENT, name : this.kPARENT,
value : parent ? parent.id : -1, value : parent ? parent.id : -1,