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

Unified Diff: chrome/browser/resources/file_manager/js/image_editor/gallery.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/gallery.js
diff --git a/chrome/browser/resources/file_manager/js/image_editor/gallery.js b/chrome/browser/resources/file_manager/js/image_editor/gallery.js
index bc59ba1f6b349a90e5e3071cde46a1cc4e6b6898..a6059cb62ce86b24154664bba914afbd2838c2c9 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/gallery.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/gallery.js
@@ -575,7 +575,12 @@ Gallery.prototype.onKeyDown_ = function(event) {
if (this.isEditing_() && this.editor_.onKeyDown(event))
return;
- switch (event.keyIdentifier) {
+ switch (util.getKeyModifiers(event) + event.keyIdentifier) {
+ case 'U+0008': // Backspace.
+ // The default handler would call history.back and close the Gallery.
+ event.preventDefault();
+ break;
+
case 'U+001B': // Escape
if (this.isEditing_()) {
this.onEdit_();
@@ -611,9 +616,8 @@ Gallery.prototype.onKeyDown_ = function(event) {
this.ribbon_.selectLast();
break;
- case 'U+00DD':
- if (event.ctrlKey) // Ctrl+] (cryptic on purpose).
- this.ribbon_.toggleDebugSlideshow();
+ case 'Ctrl-U+00DD': // Ctrl+] (cryptic on purpose).
+ this.ribbon_.toggleDebugSlideshow();
break;
}
};

Powered by Google App Engine
This is Rietveld 408576698