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

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, 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/api_listener.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 editBookmark: editBookmark, 178 editBookmark: editBookmark,
176 moveBookmark: moveBookmark, 179 moveBookmark: moveBookmark,
177 refreshNodes: refreshNodes, 180 refreshNodes: refreshNodes,
178 removeBookmark: removeBookmark, 181 removeBookmark: removeBookmark,
179 selectFolder: selectFolder, 182 selectFolder: selectFolder,
180 selectItem: selectItem, 183 selectItem: selectItem,
181 setSearchResults: setSearchResults, 184 setSearchResults: setSearchResults,
182 setSearchTerm: setSearchTerm, 185 setSearchTerm: setSearchTerm,
183 }; 186 };
184 }); 187 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/api_listener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698