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

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

Issue 2759073002: MD Webui: Improve accessibility of toolbar search field (Closed)
Patch Set: Use toString Created 3 years, 9 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 Boolean(!narrow).toString();
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
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 });
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