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

Side by Side Diff: chrome/browser/resources/md_bookmarks/folder_node.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-folder-node', 6 is: 'bookmarks-folder-node',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } else { 103 } else {
104 handled = false; 104 handled = false;
105 } 105 }
106 106
107 if (this.getComputedStyleValue('direction') == 'rtl') 107 if (this.getComputedStyleValue('direction') == 'rtl')
108 xDirection *= -1; 108 xDirection *= -1;
109 109
110 this.changeKeyboardSelection_( 110 this.changeKeyboardSelection_(
111 xDirection, yDirection, this.root.activeElement); 111 xDirection, yDirection, this.root.activeElement);
112 112
113 if (!handled) {
114 handled = bookmarks.CommandManager.getInstance().handleKeyEvent(
115 e, new Set([this.itemId]));
116 }
117
113 if (!handled) 118 if (!handled)
114 return; 119 return;
115 120
116 e.preventDefault(); 121 e.preventDefault();
117 e.stopPropagation(); 122 e.stopPropagation();
118 }, 123 },
119 124
120 /** 125 /**
121 * @private 126 * @private
122 * @param {number} xDirection 127 * @param {number} xDirection
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 }, 340 },
336 341
337 /** 342 /**
338 * @private 343 * @private
339 * @return {string} 344 * @return {string}
340 */ 345 */
341 getTabIndex_: function() { 346 getTabIndex_: function() {
342 return this.isSelectedFolder_ ? '0' : ''; 347 return this.isSelectedFolder_ ? '0' : '';
343 }, 348 },
344 }); 349 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/folder_node.html ('k') | chrome/browser/resources/md_bookmarks/list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698