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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 /** | 74 /** |
75 * @param {boolean} narrow | 75 * @param {boolean} narrow |
76 * @return {number} | 76 * @return {number} |
77 * @private | 77 * @private |
78 */ | 78 */ |
79 computeIconTabIndex_: function(narrow) { | 79 computeIconTabIndex_: function(narrow) { |
80 return narrow ? 0 : -1; | 80 return narrow ? 0 : -1; |
81 }, | 81 }, |
82 | 82 |
83 /** | 83 /** |
84 * @param {boolean} narrow | |
85 * @return {string} | |
86 * @private | |
87 */ | |
88 computeIconAriaHidden_: function(narrow) { | |
89 return narrow ? 'false' : 'true'; | |
dpapad
2017/03/20 18:07:18
Nit (optional): Equivalent to
return Boolean(narro
tsergeant
2017/03/20 23:22:02
Done, with an extra ! in there:
return Boolean(!n
| |
90 }, | |
91 | |
92 /** | |
84 * @return {boolean} | 93 * @return {boolean} |
85 * @private | 94 * @private |
86 */ | 95 */ |
87 computeIsSpinnerShown_: function() { | 96 computeIsSpinnerShown_: function() { |
88 return this.spinnerActive && this.showingSearch; | 97 return this.spinnerActive && this.showingSearch; |
89 }, | 98 }, |
90 | 99 |
91 /** @private */ | 100 /** @private */ |
92 onInputFocus_: function() { | 101 onInputFocus_: function() { |
93 this.searchFocused_ = true; | 102 this.searchFocused_ = true; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 | 145 |
137 if (this.showingSearch) { | 146 if (this.showingSearch) { |
138 this.focus_(); | 147 this.focus_(); |
139 return; | 148 return; |
140 } | 149 } |
141 | 150 |
142 this.setValue(''); | 151 this.setValue(''); |
143 this.getSearchInput().blur(); | 152 this.getSearchInput().blur(); |
144 }, | 153 }, |
145 }); | 154 }); |
OLD | NEW |