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

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

Issue 2885723002: [MD Bookmarks] Add keyboard navigation and selection to bookmark list. (Closed)
Patch Set: address comments Created 3 years, 7 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 | « chrome/browser/resources/md_bookmarks/list.js ('k') | chrome/test/data/webui/md_bookmarks/item_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/reducers.js
diff --git a/chrome/browser/resources/md_bookmarks/reducers.js b/chrome/browser/resources/md_bookmarks/reducers.js
index 0f28d8410509f08b9ed55763c56d86be5f8df5d1..b084724ed07bf7723a61acd6f885d58ca1ae3505 100644
--- a/chrome/browser/resources/md_bookmarks/reducers.js
+++ b/chrome/browser/resources/md_bookmarks/reducers.js
@@ -65,6 +65,17 @@ cr.define('bookmarks', function() {
};
/**
+ * @param {SelectionState} selectionState
+ * @param {Action} action
+ * @return {SelectionState}
+ */
+ SelectionState.updateAnchor = function(selectionState, action) {
+ return /** @type {SelectionState} */ (Object.assign({}, selectionState, {
+ anchor: action.anchor,
+ }));
+ };
+
+ /**
* @param {SelectionState} selection
* @param {Action} action
* @return {SelectionState}
@@ -81,6 +92,8 @@ cr.define('bookmarks', function() {
case 'remove-bookmark':
return SelectionState.deselectDeletedItems(
selection, action.descendants);
+ case 'update-anchor':
+ return SelectionState.updateAnchor(selection, action);
default:
return selection;
}
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.js ('k') | chrome/test/data/webui/md_bookmarks/item_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698