| 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: 'cr-toolbar-search-field', | 6 is: 'cr-toolbar-search-field', |
| 7 | 7 |
| 8 behaviors: [CrSearchFieldBehavior], | 8 behaviors: [CrSearchFieldBehavior], |
| 9 | 9 |
| 10 properties: { | 10 properties: { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 */ | 87 */ |
| 88 computeIconAriaHidden_: function(narrow) { | 88 computeIconAriaHidden_: function(narrow) { |
| 89 return Boolean(!narrow).toString(); | 89 return Boolean(!narrow).toString(); |
| 90 }, | 90 }, |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * @return {boolean} | 93 * @return {boolean} |
| 94 * @private | 94 * @private |
| 95 */ | 95 */ |
| 96 computeIsSpinnerShown_: function() { | 96 computeIsSpinnerShown_: function() { |
| 97 return this.spinnerActive && this.showingSearch; | 97 var showSpinner = this.spinnerActive && this.showingSearch; |
| 98 if (showSpinner) |
| 99 this.$.spinnerTemplate.if = true; |
| 100 return showSpinner; |
| 98 }, | 101 }, |
| 99 | 102 |
| 100 /** @private */ | 103 /** @private */ |
| 101 onInputFocus_: function() { | 104 onInputFocus_: function() { |
| 102 this.searchFocused_ = true; | 105 this.searchFocused_ = true; |
| 103 }, | 106 }, |
| 104 | 107 |
| 105 /** @private */ | 108 /** @private */ |
| 106 onInputBlur_: function() { | 109 onInputBlur_: function() { |
| 107 this.searchFocused_ = false; | 110 this.searchFocused_ = false; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 148 |
| 146 if (this.showingSearch) { | 149 if (this.showingSearch) { |
| 147 this.focus_(); | 150 this.focus_(); |
| 148 return; | 151 return; |
| 149 } | 152 } |
| 150 | 153 |
| 151 this.setValue(''); | 154 this.setValue(''); |
| 152 this.getSearchInput().blur(); | 155 this.getSearchInput().blur(); |
| 153 }, | 156 }, |
| 154 }); | 157 }); |
| OLD | NEW |