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

Side by Side Diff: ui/webui/resources/js/cr/ui/tabs.js

Issue 2104103002: Convert Event#keyIdentifier (deprecated) to Event#key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch file manager test Created 4 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 | « ui/webui/resources/js/cr/ui/overlay.js ('k') | ui/webui/resources/js/cr/ui/tree.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 cr.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 6
7 /** 7 /**
8 * Returns the TabBox for a Tab or a TabPanel. 8 * Returns the TabBox for a Tab or a TabPanel.
9 * @param {Tab|TabPanel} el The tab or tabpanel element. 9 * @param {Tab|TabPanel} el The tab or tabpanel element.
10 * @return {TabBox} The tab box if found. 10 * @return {TabBox} The tab box if found.
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 }, 143 },
144 144
145 /** 145 /**
146 * Handle keydown to change the selected tab when the user presses the 146 * Handle keydown to change the selected tab when the user presses the
147 * arrow keys. 147 * arrow keys.
148 * @param {Event} e The keyboard event. 148 * @param {Event} e The keyboard event.
149 * @private 149 * @private
150 */ 150 */
151 handleKeyDown_: function(e) { 151 handleKeyDown_: function(e) {
152 var delta = 0; 152 var delta = 0;
153 switch (e.keyIdentifier) { 153 switch (e.key) {
154 case 'Left': 154 case 'ArrowLeft':
155 case 'Up': 155 case 'ArrowUp':
156 delta = -1; 156 delta = -1;
157 break; 157 break;
158 case 'Right': 158 case 'ArrowRight':
159 case 'Down': 159 case 'ArrowDown':
160 delta = 1; 160 delta = 1;
161 break; 161 break;
162 } 162 }
163 163
164 if (!delta) 164 if (!delta)
165 return; 165 return;
166 166
167 var cs = this.ownerDocument.defaultView.getComputedStyle(this); 167 var cs = this.ownerDocument.defaultView.getComputedStyle(this);
168 if (cs.direction == 'rtl') 168 if (cs.direction == 'rtl')
169 delta *= -1; 169 delta *= -1;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 cr.defineProperty(TabPanel, 'selected', cr.PropertyKind.BOOL_ATTR); 232 cr.defineProperty(TabPanel, 'selected', cr.PropertyKind.BOOL_ATTR);
233 233
234 return { 234 return {
235 TabBox: TabBox, 235 TabBox: TabBox,
236 Tabs: Tabs, 236 Tabs: Tabs,
237 Tab: Tab, 237 Tab: Tab,
238 TabPanels: TabPanels, 238 TabPanels: TabPanels,
239 TabPanel: TabPanel 239 TabPanel: TabPanel
240 }; 240 };
241 }); 241 });
OLDNEW
« no previous file with comments | « ui/webui/resources/js/cr/ui/overlay.js ('k') | ui/webui/resources/js/cr/ui/tree.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698