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

Unified Diff: chrome/browser/resources/file_manager/js/image_editor/image_editor.js

Issue 9567003: Prevented default backspace handler in File Browser Gallery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better handling for key modifiers Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/js/image_editor/image_editor.js
diff --git a/chrome/browser/resources/file_manager/js/image_editor/image_editor.js b/chrome/browser/resources/file_manager/js/image_editor/image_editor.js
index 6115a36489a84d9ce3928015c7c15d099b1da078..37701311020fd06c0d53cbf85d19253cbd27520b 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/image_editor.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/image_editor.js
@@ -414,7 +414,7 @@ ImageEditor.prototype.leaveModeGently = function() {
};
ImageEditor.prototype.onKeyDown = function(event) {
- switch(event.keyIdentifier) {
+ switch(util.getKeyModifiers(event) + event.keyIdentifier) {
case 'U+001B': // Escape
case 'Enter':
if (this.getMode()) {
@@ -423,19 +423,17 @@ ImageEditor.prototype.onKeyDown = function(event) {
}
break;
- case 'U+005A': // 'z'
- if (event.ctrlKey) {
- if (event.shiftKey) {
- if (this.commandQueue_.canRedo()) {
- this.redo();
- return true;
- }
- } else {
- if (this.commandQueue_.canUndo()) {
- this.undo();
- return true;
- }
- }
+ case 'Ctrl-U+005A': // Ctrl+Z
+ if (this.commandQueue_.canUndo()) {
+ this.undo();
+ return true;
+ }
+ break;
+
+ case 'Ctrl-Shift-U+005A': // Ctrl+Shift-Z
+ if (this.commandQueue_.canRedo()) {
+ this.redo();
+ return true;
}
break;
}

Powered by Google App Engine
This is Rietveld 408576698