OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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('cr.ui', function() { | 5 cr.define('cr.ui', function() { |
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
7 /** @const */ var List = cr.ui.List; | 7 /** @const */ var List = cr.ui.List; |
8 /** @const */ var ListItem = cr.ui.ListItem; | 8 /** @const */ var ListItem = cr.ui.ListItem; |
9 | 9 |
10 /** | 10 /** |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 syncWidthAndPositionToInput: function() { | 209 syncWidthAndPositionToInput: function() { |
210 var input = this.targetInput_; | 210 var input = this.targetInput_; |
211 if (input) { | 211 if (input) { |
212 this.style.width = input.getBoundingClientRect().width + 'px'; | 212 this.style.width = input.getBoundingClientRect().width + 'px'; |
213 cr.ui.positionPopupAroundElement(input, this, cr.ui.AnchorType.BELOW); | 213 cr.ui.positionPopupAroundElement(input, this, cr.ui.AnchorType.BELOW); |
214 } | 214 } |
215 }, | 215 }, |
216 | 216 |
217 /** | 217 /** |
218 * syncWidthAndPositionToInput function bound to |this|. | 218 * syncWidthAndPositionToInput function bound to |this|. |
219 * @type {Function} | 219 * @type {!Function|undefined} |
220 * @private | 220 * @private |
221 */ | 221 */ |
222 boundSyncWidthAndPositionToInput_: undefined, | 222 boundSyncWidthAndPositionToInput_: undefined, |
223 | 223 |
224 /** | 224 /** |
225 * @return {HTMLElement} The text field the autocomplete popup is currently | 225 * @return {HTMLElement} The text field the autocomplete popup is currently |
226 * attached to, if any. | 226 * attached to, if any. |
227 */ | 227 */ |
228 get targetInput() { | 228 get targetInput() { |
229 return this.targetInput_; | 229 return this.targetInput_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 event.preventDefault(); | 264 event.preventDefault(); |
265 event.stopPropagation(); | 265 event.stopPropagation(); |
266 } | 266 } |
267 }, | 267 }, |
268 }; | 268 }; |
269 | 269 |
270 return { | 270 return { |
271 AutocompleteList: AutocompleteList | 271 AutocompleteList: AutocompleteList |
272 }; | 272 }; |
273 }); | 273 }); |
OLD | NEW |