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

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

Issue 2777503002: [MD Bookmarks] Deselect items when clicking outside the bookmark card. (Closed)
Patch Set: rebase 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 /** 46 /**
47 * @param {SelectionState} selection 47 * @param {SelectionState} selection
48 * @param {Action} action 48 * @param {Action} action
49 * @return {SelectionState} 49 * @return {SelectionState}
50 */ 50 */
51 SelectionState.updateSelection = function(selection, action) { 51 SelectionState.updateSelection = function(selection, action) {
52 switch (action.name) { 52 switch (action.name) {
53 case 'clear-search': 53 case 'clear-search':
54 case 'finish-search': 54 case 'finish-search':
55 case 'select-folder': 55 case 'select-folder':
56 case 'deselect-items':
56 return SelectionState.deselectAll(selection); 57 return SelectionState.deselectAll(selection);
57 case 'select-items': 58 case 'select-items':
58 return SelectionState.selectItems(selection, action); 59 return SelectionState.selectItems(selection, action);
59 } 60 }
60 return selection; 61 return selection;
61 }; 62 };
62 63
63 var SearchState = {}; 64 var SearchState = {};
64 65
65 /** 66 /**
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 345
345 return { 346 return {
346 reduceAction: reduceAction, 347 reduceAction: reduceAction,
347 ClosedFolderState: ClosedFolderState, 348 ClosedFolderState: ClosedFolderState,
348 NodeState: NodeState, 349 NodeState: NodeState,
349 SearchState: SearchState, 350 SearchState: SearchState,
350 SelectedFolderState: SelectedFolderState, 351 SelectedFolderState: SelectedFolderState,
351 SelectionState: SelectionState, 352 SelectionState: SelectionState,
352 }; 353 };
353 }); 354 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.js ('k') | chrome/test/data/webui/md_bookmarks/list_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698