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

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

Issue 2740863003: MD Bookmarks: Implement search and selection in new data flow system (Closed)
Patch Set: Remove selection from this CL Created 3 years, 9 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_bookmarks/toolbar.js
diff --git a/chrome/browser/resources/md_bookmarks/toolbar.js b/chrome/browser/resources/md_bookmarks/toolbar.js
index 5b80c74fbef76ca922d66d67cd7c0c724778a044..6b89342cf60b2116c08b802315b13bf06ec394c7 100644
--- a/chrome/browser/resources/md_bookmarks/toolbar.js
+++ b/chrome/browser/resources/md_bookmarks/toolbar.js
@@ -5,13 +5,24 @@
Polymer({
is: 'bookmarks-toolbar',
+ behaviors: [
+ bookmarks.StoreClient,
+ ],
+
properties: {
- searchTerm: {
+ /** @private */
+ searchTerm_: {
type: String,
observer: 'onSearchTermChanged_',
},
},
+ attached: function() {
+ this.watch('searchTerm_', function(state) {
+ return state.search.term;
+ });
+ },
+
/** @return {CrToolbarSearchFieldElement} */
get searchField() {
return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar'))
@@ -66,11 +77,11 @@ Polymer({
*/
onSearchChanged_: function(e) {
var searchTerm = /** @type {string} */ (e.detail);
- this.fire('search-term-changed', searchTerm);
+ this.dispatch(bookmarks.actions.setSearchTerm(searchTerm));
},
/** @private */
onSearchTermChanged_: function() {
- this.searchField.setValue(this.searchTerm || '');
+ this.searchField.setValue(this.searchTerm_ || '');
},
});

Powered by Google App Engine
This is Rietveld 408576698