OLD | NEW |
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 _keyDown: function(event) | 292 _keyDown: function(event) |
293 { | 293 { |
294 if (!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) | 294 if (!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) |
295 return; | 295 return; |
296 | 296 |
297 var keyboardEvent = /** @type {!KeyboardEvent} */ (event); | 297 var keyboardEvent = /** @type {!KeyboardEvent} */ (event); |
298 // Ctrl/Cmd + 1-9 should show corresponding panel. | 298 // Ctrl/Cmd + 1-9 should show corresponding panel. |
299 var panelShortcutEnabled = WebInspector.settings.shortcutPanelSwitch.get
(); | 299 var panelShortcutEnabled = WebInspector.settings.shortcutPanelSwitch.get
(); |
300 if (panelShortcutEnabled && !event.shiftKey && !event.altKey) { | 300 if (panelShortcutEnabled && !event.shiftKey && !event.altKey) { |
| 301 var keyCode = event.keyCode || event["__keyCode"] || 0; |
301 var panelIndex = -1; | 302 var panelIndex = -1; |
302 if (event.keyCode > 0x30 && event.keyCode < 0x3A) | 303 if (keyCode > 0x30 && keyCode < 0x3A) |
303 panelIndex = event.keyCode - 0x31; | 304 panelIndex = keyCode - 0x31; |
304 else if (event.keyCode > 0x60 && event.keyCode < 0x6A && keyboardEve
nt.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) | 305 else if (keyCode > 0x60 && keyCode < 0x6A && keyboardEvent.location
=== KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) |
305 panelIndex = event.keyCode - 0x61; | 306 panelIndex = keyCode - 0x61; |
306 if (panelIndex !== -1) { | 307 if (panelIndex !== -1) { |
307 var panelName = this._tabbedPane.allTabs()[panelIndex]; | 308 var panelName = this._tabbedPane.allTabs()[panelIndex]; |
308 if (panelName) { | 309 if (panelName) { |
309 this.showPanel(panelName); | 310 this.showPanel(panelName); |
310 event.consume(true); | 311 event.consume(true); |
311 } | 312 } |
312 return; | 313 return; |
313 } | 314 } |
314 } | 315 } |
315 | 316 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 window.addEventListener("scroll", this._onScrollBound, false); | 500 window.addEventListener("scroll", this._onScrollBound, false); |
500 else | 501 else |
501 window.removeEventListener("scroll", this._onScrollBound, false); | 502 window.removeEventListener("scroll", this._onScrollBound, false); |
502 | 503 |
503 WebInspector.VBox.prototype.doResize.call(this); | 504 WebInspector.VBox.prototype.doResize.call(this); |
504 this._onScroll(); | 505 this._onScroll(); |
505 }, | 506 }, |
506 | 507 |
507 __proto__: WebInspector.VBox.prototype | 508 __proto__: WebInspector.VBox.prototype |
508 }; | 509 }; |
OLD | NEW |