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

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

Issue 2159773003: MD History: Add shortcuts for 'Delete' and 'Backspace' to delete selected items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@MDH_slash_key
Patch Set: 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
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 18df6abd69253c827e6fe66b1bb9a12272d05c19..f7fc6c3b680ac1a201c8e854c985bf01048f5573 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -128,6 +128,9 @@ Polymer({
!(this.$.toolbar.searchBar.showingSearch &&
this.$.toolbar.searchBar.isSearchFocused());
break;
+ case 'delete-command':
+ e.canExecute = this.$['history'].getHistoryList().numToBeDeleted() > 0;
tsergeant 2016/07/19 05:09:41 You could probably simplify this using `this.$.too
lshang 2016/07/20 01:19:09 Done.
+ break;
}
},
@@ -138,6 +141,8 @@ Polymer({
onCommand_: function(e) {
if (e.command.id == 'find-command' || e.command.id == 'slash-command')
this.$.toolbar.showSearchField();
+ if (e.command.id == 'delete-command')
+ this.deleteSelected();
},
/**
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history.html » ('j') | chrome/browser/resources/md_history/history_list.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698