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

Side by Side Diff: chrome/browser/resources/md_bookmarks/reducers.js

Issue 2776993002: [MD Bookmarks] Persist collapsed folders between page loads. (Closed)
Patch Set: fix closure Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Module of functions which produce a new page state in response 6 * @fileoverview Module of functions which produce a new page state in response
7 * to an action. Reducers (in the same sense as Array.prototype.reduce) must be 7 * to an action. Reducers (in the same sense as Array.prototype.reduce) must be
8 * pure functions: they must not modify existing state objects, or make any API 8 * pure functions: they must not modify existing state objects, or make any API
9 * calls. 9 * calls.
10 */ 10 */
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 SelectedFolderState.isAncestorOf( 251 SelectedFolderState.isAncestorOf(
252 nodes, action.id, selectedFolder)) { 252 nodes, action.id, selectedFolder)) {
253 return action.id; 253 return action.id;
254 } 254 }
255 return selectedFolder; 255 return selectedFolder;
256 case 'finish-search': 256 case 'finish-search':
257 return null; 257 return null;
258 case 'clear-search': 258 case 'clear-search':
259 // TODO(tsergeant): Return to the folder that was selected before the 259 // TODO(tsergeant): Return to the folder that was selected before the
260 // search. 260 // search.
261 return nodes[bookmarks.util.ROOT_NODE_ID].children[0]; 261 return nodes[ROOT_NODE_ID].children[0];
262 default: 262 default:
263 return selectedFolder; 263 return selectedFolder;
264 } 264 }
265 }; 265 };
266 266
267 var ClosedFolderState = {}; 267 var ClosedFolderState = {};
268 268
269 /** 269 /**
270 * @param {ClosedFolderState} closedFolders 270 * @param {ClosedFolderState} closedFolders
271 * @param {string|undefined} id 271 * @param {string|undefined} id
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 return { 346 return {
347 reduceAction: reduceAction, 347 reduceAction: reduceAction,
348 ClosedFolderState: ClosedFolderState, 348 ClosedFolderState: ClosedFolderState,
349 NodeState: NodeState, 349 NodeState: NodeState,
350 SearchState: SearchState, 350 SearchState: SearchState,
351 SelectedFolderState: SelectedFolderState, 351 SelectedFolderState: SelectedFolderState,
352 SelectionState: SelectionState, 352 SelectionState: SelectionState,
353 }; 353 };
354 }); 354 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/reducers.html ('k') | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698