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

Unified Diff: Source/WebCore/inspector/front-end/InspectorView.js

Issue 9965056: Merge 112539 - Web Inspector: "go to the previous panel" shortcut is painful to maintain (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/inspector/front-end/InspectorView.js
===================================================================
--- Source/WebCore/inspector/front-end/InspectorView.js (revision 112843)
+++ Source/WebCore/inspector/front-end/InspectorView.js (working copy)
@@ -88,22 +88,6 @@
_keyDown: function(event)
{
switch (event.keyIdentifier) {
- case "Left":
- var isBackKey = !event.shiftKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !WebInspector.isBeingEdited(event.target);
- if (isBackKey && this._canGoBackInHistory()) {
- this._goBackInHistory();
- event.preventDefault();
- }
- break;
-
- case "Right":
- var isForwardKey = !event.shiftKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !WebInspector.isBeingEdited(event.target);
- if (isForwardKey && this._canGoForwardInHistory()) {
- this._goForwardInHistory();
- event.preventDefault();
- }
- break;
-
// Windows and Mac have two different definitions of [, so accept both.
case "U+005B":
case "U+00DB": // [ key
@@ -112,8 +96,15 @@
var index = this._panelOrder.indexOf(this.currentPanel());
index = (index === 0) ? this._panelOrder.length - 1 : index - 1;
this._panelOrder[index].toolbarItem.click();
- event.preventDefault();
+ event.consume();
+ return;
}
+
+ var isGoBack = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
+ if (isGoBack && this._canGoBackInHistory()) {
+ this._goBackInHistory();
+ event.consume();
+ }
break;
// Windows and Mac have two different definitions of ], so accept both.
@@ -124,9 +115,15 @@
var index = this._panelOrder.indexOf(this.currentPanel());
index = (index + 1) % this._panelOrder.length;
this._panelOrder[index].toolbarItem.click();
- event.preventDefault();
+ event.consume();
+ return;
}
-
+
+ var isGoForward = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
+ if (isGoForward && this._canGoForwardInHistory()) {
+ this._goForwardInHistory();
+ event.consume();
+ }
break;
}
},
« no previous file with comments | « Source/WebCore/inspector/front-end/ConsoleView.js ('k') | Source/WebCore/inspector/front-end/ScriptsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698