From c595c8ba222a376c70fc6f55c300736dbba484f7 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 30 Sep 2014 19:59:15 +0900 Subject: [PATCH] Restore tree structure with multiple trees from bookmarks correctly, even if the dummy tab is disabled. (#662) --- content/treestyletab/bookmarksOverlay.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index ff3dfe0f..139eb165 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -395,6 +395,10 @@ var TreeStyleTabBookmarksService = inherit(TreeStyleTabService, { null : sv.getTreeStructureFromItems(aIDs) ; if (treeStructure) { + let parentTabs = treeStructure.filter(function(aParent) { + return aParent < 0; + }); + let haveMultipleTrees = parentTabs.length != treeStructure.length; if (result.behavior & sv.kGROUP_BOOKMARK_USE_DUMMY) { let parentCount = 0; let childCount = 0; @@ -420,7 +424,7 @@ var TreeStyleTabBookmarksService = inherit(TreeStyleTabService, { })); } } - else { + else if (!haveMultipleTrees) { // make the first item parent. treeStructure = treeStructure.map(function(aParent, aIndex) { if (aIndex == 0)