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

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

Issue 2752223004: MD Bookmarks: Remove deleted nodes from state tree (Closed)
Patch Set: Rebase 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 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 for functions which produce action objects. These are 6 * @fileoverview Module for functions which produce action objects. These are
7 * listed in one place to document available actions and their parameters. 7 * listed in one place to document available actions and their parameters.
8 */ 8 */
9 9
10 cr.define('bookmarks.actions', function() { 10 cr.define('bookmarks.actions', function() {
(...skipping 26 matching lines...) Expand all
37 index: index, 37 index: index,
38 oldParentId: oldParentId, 38 oldParentId: oldParentId,
39 oldIndex: oldIndex, 39 oldIndex: oldIndex,
40 }; 40 };
41 } 41 }
42 42
43 /** 43 /**
44 * @param {string} id 44 * @param {string} id
45 * @param {string} parentId 45 * @param {string} parentId
46 * @param {number} index 46 * @param {number} index
47 * @param {NodeList} nodes
47 * @return {!Action} 48 * @return {!Action}
48 */ 49 */
49 function removeBookmark(id, parentId, index) { 50 function removeBookmark(id, parentId, index, nodes) {
tsergeant 2017/03/23 05:36:07 My intention is still that actions should be able
51 var descendants = bookmarks.util.getDescendants(nodes, id);
50 return { 52 return {
51 name: 'remove-bookmark', 53 name: 'remove-bookmark',
52 id: id, 54 id: id,
55 descendants: descendants,
53 parentId: parentId, 56 parentId: parentId,
54 index: index, 57 index: index,
55 }; 58 };
56 } 59 }
57 60
58 /** 61 /**
59 * @param {NodeList} nodeMap 62 * @param {NodeList} nodeMap
60 * @return {!Action} 63 * @return {!Action}
61 */ 64 */
62 function refreshNodes(nodeMap) { 65 function refreshNodes(nodeMap) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 editBookmark: editBookmark, 170 editBookmark: editBookmark,
168 moveBookmark: moveBookmark, 171 moveBookmark: moveBookmark,
169 refreshNodes: refreshNodes, 172 refreshNodes: refreshNodes,
170 removeBookmark: removeBookmark, 173 removeBookmark: removeBookmark,
171 selectFolder: selectFolder, 174 selectFolder: selectFolder,
172 selectItem: selectItem, 175 selectItem: selectItem,
173 setSearchResults: setSearchResults, 176 setSearchResults: setSearchResults,
174 setSearchTerm: setSearchTerm, 177 setSearchTerm: setSearchTerm,
175 }; 178 };
176 }); 179 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698