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

Unified Diff: chrome/browser/resources/md_downloads/toolbar.js

Issue 1271643002: MD downloads: implement (x) inside of search input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 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_downloads/toolbar.js
diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js
index bc83c00e979e86fcb0698db3167ac89186612706..86a22deb243b216f3e8dcd9e6fe14f025ef02633 100644
--- a/chrome/browser/resources/md_downloads/toolbar.js
+++ b/chrome/browser/resources/md_downloads/toolbar.js
@@ -32,13 +32,7 @@ cr.define('downloads', function() {
/** @return {boolean} Whether "Clear all" should be allowed. */
canClearAll: function() {
- return !this.$['search-term'].value && this.downloadsShowing;
- },
-
- ready: function() {
- var term = this.$['search-term'];
- term.addEventListener('input', this.onSearchTermInput_.bind(this));
- term.addEventListener('keydown', this.onSearchTermKeydown_.bind(this));
+ return !this.$['search-input'].value && this.downloadsShowing;
},
/** @private */
@@ -53,8 +47,8 @@ cr.define('downloads', function() {
},
/** @private */
- onSearchTermInput_: function() {
- this.actionService_.search(this.$['search-term'].value);
+ onSearchTermSearch_: function() {
+ this.actionService_.search(this.$['search-input'].value);
this.updateClearAll_();
},
@@ -75,10 +69,10 @@ cr.define('downloads', function() {
this.showingSearch_ = !this.showingSearch_;
if (this.showingSearch_) {
- this.$['search-term'].focus();
+ this.$['search-input'].focus();
} else {
- this.$['search-term'].value = '';
- this.onSearchTermInput_();
+ this.$['search-input'].value = '';
+ this.onSearchTermSearch_();
}
},

Powered by Google App Engine
This is Rietveld 408576698