Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js

Issue 2861093002: MD WebUI: Reduce flickering of spinner in toolbar search field (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698