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

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

Issue 2885353002: MD Bookmarks: Prevent keyboard shortcuts when the toolbar/dialogs are focused (Closed)
Patch Set: Add a test Created 3 years, 6 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 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 clear: !e.ctrlKey, 172 clear: !e.ctrlKey,
173 range: e.shiftKey, 173 range: e.shiftKey,
174 toggle: false, 174 toggle: false,
175 }; 175 };
176 176
177 this.dispatch(bookmarks.actions.selectItem( 177 this.dispatch(bookmarks.actions.selectItem(
178 this.displayedIds_[focusedIndex], this.getState(), config)); 178 this.displayedIds_[focusedIndex], this.getState(), config));
179 } 179 }
180 } 180 }
181 181
182 // Prevent the iron-list from changing focus on enter.
183 if (e.path[0] instanceof HTMLButtonElement && e.key == 'Enter')
184 handled = true;
185
186 if (!handled) {
187 handled = bookmarks.CommandManager.getInstance().handleKeyEvent(
188 e, this.getState().selection.items);
189 }
190
182 if (handled) 191 if (handled)
183 e.stopPropagation(); 192 e.stopPropagation();
184 }, 193 },
185 }); 194 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.html ('k') | 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