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

Unified Diff: Source/devtools/front_end/ui/ShortcutRegistry.js

Issue 659403006: DevTools: do not consider ? a shortcut while editing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 6 years, 2 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
« no previous file with comments | « Source/devtools/front_end/sources/WorkspaceMappingTip.js ('k') | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/ShortcutRegistry.js
diff --git a/Source/devtools/front_end/ui/ShortcutRegistry.js b/Source/devtools/front_end/ui/ShortcutRegistry.js
index 064aab9f5c07f8f3c2a449a5605bed9c2deab9a6..d5fa6c205c8f4cdcbfe0d1f97f784f6a0ca75933 100644
--- a/Source/devtools/front_end/ui/ShortcutRegistry.js
+++ b/Source/devtools/front_end/ui/ShortcutRegistry.js
@@ -92,16 +92,21 @@ WebInspector.ShortcutRegistry.prototype = {
{
var keyModifiers = key >> 8;
var actionIds = this.applicableActions(key);
+ if (!actionIds.length)
+ return;
if (WebInspector.GlassPane.DefaultFocusedViewStack.length > 1) {
- if (event && actionIds.length && !isPossiblyInputKey())
+ if (event && !isPossiblyInputKey())
event.consume(true);
return;
}
- if (!isPossiblyInputKey())
+ if (!isPossiblyInputKey()) {
+ if (event)
+ event.consume(true);
processActionIdsSequentially.call(this);
- else
+ } else {
this._pendingActionTimer = setTimeout(processActionIdsSequentially.bind(this), 0);
+ }
/**
* @this {WebInspector.ShortcutRegistry}
@@ -120,13 +125,8 @@ WebInspector.ShortcutRegistry.prototype = {
*/
function continueIfNecessary(result)
{
- // Note that this is a best effort solution - lazily loaded modules won't have a chance to
- // consume platform event.
- if (result) {
- if (event)
- event.consume(true);
+ if (result)
return;
- }
processActionIdsSequentially.call(this);
}
}
@@ -136,7 +136,7 @@ WebInspector.ShortcutRegistry.prototype = {
*/
function isPossiblyInputKey()
{
- if (!event || !WebInspector.isBeingEdited(/** @type {!Node} */ (event.target)) || /^F\d+|Control|Shift|Alt|Meta|Win|U\+001B$/.test(keyIdentifier))
+ if (!event || !WebInspector.isEditing() || /^F\d+|Control|Shift|Alt|Meta|Win|U\+001B$/.test(keyIdentifier))
return false;
if (!keyModifiers)
« no previous file with comments | « Source/devtools/front_end/sources/WorkspaceMappingTip.js ('k') | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698