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

Unified Diff: ui/file_manager/file_manager/foreground/js/import_controller.js

Issue 954523002: Hide details panel when ESC is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hide details panel when user hits ESC. Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/import_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/import_controller.js b/ui/file_manager/file_manager/foreground/js/import_controller.js
index 2f744667cbb87dab22f42a7862ddde71916e6889..d09a5cdc36eca809dfd7e2b0e94509aa77720bb5 100644
--- a/ui/file_manager/file_manager/foreground/js/import_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/import_controller.js
@@ -491,6 +491,20 @@ importer.RuntimeCommandWidget = function() {
/** @private {function(!importer.ClickSource)} */
this.clickListener_;
+
+ document.addEventListener('keydown', this.onKeyDown_.bind(this));
hirono 2015/02/24 07:40:45 Is it OK to handle the event by document? e.g. If
Steve McKay 2015/02/25 21:22:13 I think this is okay because any click outside of
+};
+
+/**
+ * Handle document scoped key-down events.
hirono 2015/02/24 07:40:45 nit: Handles
Steve McKay 2015/02/25 21:22:13 Done.
+ * @param {Event} event Key event.
+ * @private
+ */
+importer.RuntimeCommandWidget.prototype.onKeyDown_ = function(event) {
+ switch (util.getKeyModifiers(event) + event.keyIdentifier) {
+ case 'U+001B':
+ this.setDetailsVisible_(false);
+ }
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698