Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chrome/browser/resources/md_bookmarks/app.js

Issue 2722083002: [MD Bookmarks] Flatten sidebar. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/folder_node.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/app.js
diff --git a/chrome/browser/resources/md_bookmarks/app.js b/chrome/browser/resources/md_bookmarks/app.js
index 86650e07e7c49513fa88f65aea51896a416a9d97..ad95ee57889e1ccc29284bc35b266d8286dec24f 100644
--- a/chrome/browser/resources/md_bookmarks/app.js
+++ b/chrome/browser/resources/md_bookmarks/app.js
@@ -23,10 +23,13 @@ Polymer({
});
chrome.bookmarks.getTree(function(results) {
- var nodeList = bookmarks.util.normalizeNodes(results[0]);
+ var rootNode = results[0];
+ var nodeList = bookmarks.util.normalizeNodes(rootNode);
var initialState = bookmarks.util.createEmptyState();
initialState.nodes = nodeList;
- initialState.selectedFolder = nodeList['0'].children[0];
+ initialState.selectedFolder = nodeList[rootNode.id].children[0];
+ initialState.sidebar =
+ bookmarks.util.initializeSidebar(rootNode.id, nodeList);
// TODO(tsergeant): The below ends up slightly duplicating logic from
// elsewhere. Consider trying to use actions/reducers to simplify this.
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/folder_node.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698