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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js

Issue 2649263003: DevTools: restore shortcuts to switch devtool panel left/right (Closed)
Patch Set: made selectNext/Prev read nicer Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 this._drawerSplitWidget.setResizable(!minimized); 218 this._drawerSplitWidget.setResizable(!minimized);
219 } 219 }
220 220
221 /** 221 /**
222 * @return {boolean} 222 * @return {boolean}
223 */ 223 */
224 isDrawerMinimized() { 224 isDrawerMinimized() {
225 return this._drawerSplitWidget.isSidebarMinimized(); 225 return this._drawerSplitWidget.isSidebarMinimized();
226 } 226 }
227 227
228 /**
229 * @param {!Event} event
230 */
228 _keyDown(event) { 231 _keyDown(event) {
229 if (!UI.KeyboardShortcut.eventHasCtrlOrMeta(event)) 232 var keyboardEvent = /** @type {!KeyboardEvent} */ (event);
233 if (!UI.KeyboardShortcut.eventHasCtrlOrMeta(keyboardEvent))
230 return; 234 return;
231 235
232 var keyboardEvent = /** @type {!KeyboardEvent} */ (event);
233 // Ctrl/Cmd + 1-9 should show corresponding panel. 236 // Ctrl/Cmd + 1-9 should show corresponding panel.
234 var panelShortcutEnabled = Common.moduleSetting('shortcutPanelSwitch').get() ; 237 var panelShortcutEnabled = Common.moduleSetting('shortcutPanelSwitch').get() ;
235 if (panelShortcutEnabled && !event.shiftKey && !event.altKey) { 238 if (panelShortcutEnabled && !event.shiftKey && !event.altKey) {
236 var panelIndex = -1; 239 var panelIndex = -1;
237 if (event.keyCode > 0x30 && event.keyCode < 0x3A) 240 if (event.keyCode > 0x30 && event.keyCode < 0x3A)
238 panelIndex = event.keyCode - 0x31; 241 panelIndex = event.keyCode - 0x31;
239 else if ( 242 else if (
240 event.keyCode > 0x60 && event.keyCode < 0x6A && 243 event.keyCode > 0x60 && event.keyCode < 0x6A &&
241 keyboardEvent.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) 244 keyboardEvent.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD)
242 panelIndex = event.keyCode - 0x61; 245 panelIndex = event.keyCode - 0x61;
243 if (panelIndex !== -1) { 246 if (panelIndex !== -1) {
244 var panelName = this._tabbedPane.allTabs()[panelIndex]; 247 var panelName = this._tabbedPane.allTabs()[panelIndex];
245 if (panelName) { 248 if (panelName) {
246 if (!UI.Dialog.hasInstance() && !this._currentPanelLocked) 249 if (!UI.Dialog.hasInstance() && !this._currentPanelLocked)
247 this.showPanel(panelName); 250 this.showPanel(panelName);
248 event.consume(true); 251 event.consume(true);
249 } 252 }
250 } 253 }
251 } 254 }
255
256 if (event.key === '[') {
257 this._tabbedPane.selectPrevTab();
258 event.consume(true);
259 }
260
261 if (event.key === ']') {
262 this._tabbedPane.selectNextTab();
263 event.consume(true);
264 }
252 } 265 }
253 266
254 /** 267 /**
255 * @override 268 * @override
256 */ 269 */
257 onResize() { 270 onResize() {
258 UI.Dialog.modalHostRepositioned(); 271 UI.Dialog.modalHostRepositioned();
259 } 272 }
260 273
261 /** 274 /**
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 * @return {boolean} 326 * @return {boolean}
314 */ 327 */
315 handleAction(context, actionId) { 328 handleAction(context, actionId) {
316 if (UI.inspectorView.drawerVisible()) 329 if (UI.inspectorView.drawerVisible())
317 UI.inspectorView._closeDrawer(); 330 UI.inspectorView._closeDrawer();
318 else 331 else
319 UI.inspectorView._showDrawer(true); 332 UI.inspectorView._showDrawer(true);
320 return true; 333 return true;
321 } 334 }
322 }; 335 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698