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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2152753003: MD History: Fix forward slash key not working in search field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I don't feel like to describe this patch, yeah~ Created 4 years, 5 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 | chrome/browser/resources/md_history/history.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 6d3f5d4e2d111d016111463a05fa1550b1bec366..18df6abd69253c827e6fe66b1bb9a12272d05c19 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -118,7 +118,17 @@ Polymer({
* @private
*/
onCanExecute_: function(e) {
- e.canExecute = true;
+ e = /** @type {cr.ui.CanExecuteEvent} */(e);
+ switch (e.command.id) {
+ case 'find-command':
+ e.canExecute = true;
+ break;
+ case 'slash-command':
+ e.canExecute =
+ !(this.$.toolbar.searchBar.showingSearch &&
+ this.$.toolbar.searchBar.isSearchFocused());
+ break;
+ }
},
/**
@@ -126,7 +136,7 @@ Polymer({
* @private
*/
onCommand_: function(e) {
- if (e.command.id == 'find-command')
+ if (e.command.id == 'find-command' || e.command.id == 'slash-command')
this.$.toolbar.showSearchField();
},
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698