OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-ui' implements the UI for the Settings page. | 7 * 'settings-ui' implements the UI for the Settings page. |
8 * | 8 * |
9 * Example: | 9 * Example: |
10 * | 10 * |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 onSearchChanged_: function(e) { | 219 onSearchChanged_: function(e) { |
220 // Trim leading whitespace only, to prevent searching for empty string. This | 220 // Trim leading whitespace only, to prevent searching for empty string. This |
221 // still allows the user to search for 'foo bar', while taking a long pause | 221 // still allows the user to search for 'foo bar', while taking a long pause |
222 // after typing 'foo '. | 222 // after typing 'foo '. |
223 var query = e.detail.replace(/^\s+/, ''); | 223 var query = e.detail.replace(/^\s+/, ''); |
224 // Prevent duplicate history entries. | 224 // Prevent duplicate history entries. |
225 if (query == this.lastSearchQuery_) | 225 if (query == this.lastSearchQuery_) |
226 return; | 226 return; |
227 | 227 |
228 settings.navigateTo( | 228 settings.navigateTo( |
229 settings.Route.BASIC, | 229 settings.routes.BASIC, |
230 query.length > 0 ? | 230 query.length > 0 ? |
231 new URLSearchParams('search=' + encodeURIComponent(query)) : | 231 new URLSearchParams('search=' + encodeURIComponent(query)) : |
232 undefined, | 232 undefined, |
233 /* removeSearch */ true); | 233 /* removeSearch */ true); |
234 }, | 234 }, |
235 | 235 |
236 /** | 236 /** |
237 * @param {Event} event | 237 * @param {Event} event |
238 * @private | 238 * @private |
239 */ | 239 */ |
(...skipping 16 matching lines...) Expand all Loading... |
256 listenOnce(this.$.container, ['blur', 'pointerdown'], function() { | 256 listenOnce(this.$.container, ['blur', 'pointerdown'], function() { |
257 this.$.container.removeAttribute('tabindex'); | 257 this.$.container.removeAttribute('tabindex'); |
258 }.bind(this)); | 258 }.bind(this)); |
259 }, | 259 }, |
260 | 260 |
261 /** @private */ | 261 /** @private */ |
262 directionDelegateChanged_: function() { | 262 directionDelegateChanged_: function() { |
263 this.$.drawer.align = this.directionDelegate.isRtl() ? 'right' : 'left'; | 263 this.$.drawer.align = this.directionDelegate.isRtl() ? 'right' : 'left'; |
264 }, | 264 }, |
265 }); | 265 }); |
OLD | NEW |