OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Polymer({ | 5 Polymer({ |
6 is: 'bookmarks-toolbar', | 6 is: 'bookmarks-toolbar', |
7 | 7 |
8 behaviors: [ | 8 behaviors: [ |
9 bookmarks.StoreClient, | 9 bookmarks.StoreClient, |
10 ], | 10 ], |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 70 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); |
71 menu.close(); | 71 menu.close(); |
72 }, | 72 }, |
73 | 73 |
74 /** | 74 /** |
75 * @param {Event} e | 75 * @param {Event} e |
76 * @private | 76 * @private |
77 */ | 77 */ |
78 onSearchChanged_: function(e) { | 78 onSearchChanged_: function(e) { |
79 var searchTerm = /** @type {string} */ (e.detail); | 79 var searchTerm = /** @type {string} */ (e.detail); |
80 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm)); | 80 if (searchTerm != this.searchTerm_) |
calamity
2017/03/20 06:34:28
What makes this necessary?
tsergeant
2017/03/21 00:27:07
This is just a small optimisation to avoid firing
| |
81 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm)); | |
81 }, | 82 }, |
82 | 83 |
83 /** @private */ | 84 /** @private */ |
84 onSearchTermChanged_: function() { | 85 onSearchTermChanged_: function() { |
85 this.searchField.setValue(this.searchTerm_ || ''); | 86 this.searchField.setValue(this.searchTerm_ || ''); |
86 }, | 87 }, |
87 }); | 88 }); |
OLD | NEW |