| 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 // TODO(tsergeant): Add tests for cr-toolbar-search-field. | 5 // TODO(tsergeant): Add tests for cr-toolbar-search-field. |
| 6 Polymer({ | 6 Polymer({ |
| 7 is: 'cr-toolbar-search-field', | 7 is: 'cr-toolbar-search-field', |
| 8 | 8 |
| 9 behaviors: [CrSearchFieldBehavior], | 9 behaviors: [CrSearchFieldBehavior], |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 */ | 93 */ |
| 94 showSearch_: function(e) { | 94 showSearch_: function(e) { |
| 95 if (e.target != this.$.clearSearch) | 95 if (e.target != this.$.clearSearch) |
| 96 this.showingSearch = true; | 96 this.showingSearch = true; |
| 97 }, | 97 }, |
| 98 | 98 |
| 99 /** | 99 /** |
| 100 * @param {Event} e | 100 * @param {Event} e |
| 101 * @private | 101 * @private |
| 102 */ | 102 */ |
| 103 hideSearch_: function(e) { | 103 clearSearch_: function(e) { |
| 104 this.showingSearch = false; | 104 this.setValue(''); |
| 105 e.stopPropagation(); | 105 this.getSearchInput().focus(); |
| 106 } | 106 } |
| 107 }); | 107 }); |
| OLD | NEW |