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

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

Issue 2964883002: MD Bookmarks: Fix Meta-down not triggering the 'Open' command on Mac (Closed)
Patch Set: Created 3 years, 5 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/test/data/webui/md_bookmarks/command_manager_test.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'bookmarks-list', 6 is: 'bookmarks-list',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 onItemKeydown_: function(e) { 152 onItemKeydown_: function(e) {
153 var handled = true; 153 var handled = true;
154 var list = this.$.bookmarksCard; 154 var list = this.$.bookmarksCard;
155 var focusMoved = false; 155 var focusMoved = false;
156 var focusedIndex = 156 var focusedIndex =
157 this.getIndexForItemElement_(/** @type {HTMLElement} */ (e.target)); 157 this.getIndexForItemElement_(/** @type {HTMLElement} */ (e.target));
158 var oldFocusedIndex = focusedIndex; 158 var oldFocusedIndex = focusedIndex;
159 if (e.key == 'ArrowUp') { 159 if (e.key == 'ArrowUp') {
160 focusedIndex--; 160 focusedIndex--;
161 focusMoved = true; 161 focusMoved = true;
162 } else if (e.key == 'ArrowDown') { 162 } else if (e.key == 'ArrowDown' && !(cr.isMac && e.metaKey)) {
163 focusedIndex++; 163 focusedIndex++;
164 focusMoved = true; 164 focusMoved = true;
165 e.preventDefault(); 165 e.preventDefault();
166 } else if (e.key == 'Home') { 166 } else if (e.key == 'Home') {
167 focusedIndex = 0; 167 focusedIndex = 0;
168 focusMoved = true; 168 focusMoved = true;
169 } else if (e.key == 'End') { 169 } else if (e.key == 'End') {
170 focusedIndex = list.items.length - 1; 170 focusedIndex = list.items.length - 1;
171 focusMoved = true; 171 focusMoved = true;
172 } else if (e.key == ' ' && e.ctrlKey) { 172 } else if (e.key == ' ' && e.ctrlKey) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 if (!handled) { 214 if (!handled) {
215 handled = bookmarks.CommandManager.getInstance().handleKeyEvent( 215 handled = bookmarks.CommandManager.getInstance().handleKeyEvent(
216 e, this.getState().selection.items); 216 e, this.getState().selection.items);
217 } 217 }
218 218
219 if (handled) 219 if (handled)
220 e.stopPropagation(); 220 e.stopPropagation();
221 }, 221 },
222 }); 222 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/md_bookmarks/command_manager_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698