OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Component that renders a search box for searching through destinations. | 9 * Component that renders a search box for searching through destinations. |
10 * @param {string} searchBoxPlaceholderText Search box placeholder text. | 10 * @param {string} searchBoxPlaceholderText Search box placeholder text. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 /** | 44 /** |
45 * Delay in milliseconds before dispatching a SEARCH event. | 45 * Delay in milliseconds before dispatching a SEARCH event. |
46 * @private {number} | 46 * @private {number} |
47 * @const | 47 * @const |
48 */ | 48 */ |
49 SearchBox.SEARCH_DELAY_ = 150; | 49 SearchBox.SEARCH_DELAY_ = 150; |
50 | 50 |
51 SearchBox.prototype = { | 51 SearchBox.prototype = { |
52 __proto__: print_preview.Component.prototype, | 52 __proto__: print_preview.Component.prototype, |
53 | 53 |
54 /** @param {string} New query to set the search box's query to. */ | 54 /** @param {string} query New query to set the search box's query to. */ |
55 setQuery: function(query) { | 55 setQuery: function(query) { |
56 query = query || ''; | 56 query = query || ''; |
57 this.input_.value = query.trim(); | 57 this.input_.value = query.trim(); |
58 }, | 58 }, |
59 | 59 |
60 /** Sets the input element of the search box in focus. */ | 60 /** Sets the input element of the search box in focus. */ |
61 focus: function() { | 61 focus: function() { |
62 this.input_.focus(); | 62 this.input_.focus(); |
63 }, | 63 }, |
64 | 64 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 this.timeout_ = setTimeout( | 119 this.timeout_ = setTimeout( |
120 this.dispatchSearchEvent_.bind(this), SearchBox.SEARCH_DELAY_); | 120 this.dispatchSearchEvent_.bind(this), SearchBox.SEARCH_DELAY_); |
121 } | 121 } |
122 }; | 122 }; |
123 | 123 |
124 // Export | 124 // Export |
125 return { | 125 return { |
126 SearchBox: SearchBox | 126 SearchBox: SearchBox |
127 }; | 127 }; |
128 }); | 128 }); |
OLD | NEW |