| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 75 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); |
| 76 menu.close(); | 76 menu.close(); |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * @param {Event} e | 80 * @param {Event} e |
| 81 * @private | 81 * @private |
| 82 */ | 82 */ |
| 83 onSearchChanged_: function(e) { | 83 onSearchChanged_: function(e) { |
| 84 var searchTerm = /** @type {string} */ (e.detail); | 84 var searchTerm = /** @type {string} */ (e.detail); |
| 85 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm)); | 85 if (searchTerm != this.searchTerm_) |
| 86 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm)); |
| 86 }, | 87 }, |
| 87 | 88 |
| 88 onSidebarWidthChanged_: function() { | 89 onSidebarWidthChanged_: function() { |
| 89 this.style.setProperty('--sidebar-width', this.sidebarWidth); | 90 this.style.setProperty('--sidebar-width', this.sidebarWidth); |
| 90 }, | 91 }, |
| 91 | 92 |
| 92 /** @private */ | 93 /** @private */ |
| 93 onSearchTermChanged_: function() { | 94 onSearchTermChanged_: function() { |
| 94 this.searchField.setValue(this.searchTerm_ || ''); | 95 this.searchField.setValue(this.searchTerm_ || ''); |
| 95 }, | 96 }, |
| 96 }); | 97 }); |
| OLD | NEW |