| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 UI.ListWidget = class extends UI.VBox { | 7 UI.ListWidget = class extends UI.VBox { |
| 8 /** | 8 /** |
| 9 * @param {!UI.ListWidget.Delegate} delegate | 9 * @param {!UI.ListWidget.Delegate} delegate |
| 10 */ | 10 */ |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 318 } |
| 319 | 319 |
| 320 /** | 320 /** |
| 321 * @param {string} name | 321 * @param {string} name |
| 322 * @param {string} type | 322 * @param {string} type |
| 323 * @param {string} title | 323 * @param {string} title |
| 324 * @param {function(*, number, (!HTMLInputElement|!HTMLSelectElement)):boolean
} validator | 324 * @param {function(*, number, (!HTMLInputElement|!HTMLSelectElement)):boolean
} validator |
| 325 * @return {!HTMLInputElement} | 325 * @return {!HTMLInputElement} |
| 326 */ | 326 */ |
| 327 createInput(name, type, title, validator) { | 327 createInput(name, type, title, validator) { |
| 328 var input = /** @type {!HTMLInputElement} */ (createElement('input')); | 328 var input = /** @type {!HTMLInputElement} */ (UI.createInput('', type)); |
| 329 input.type = type; | |
| 330 input.placeholder = title; | 329 input.placeholder = title; |
| 331 input.addEventListener('input', this._validateControls.bind(this, false), fa
lse); | 330 input.addEventListener('input', this._validateControls.bind(this, false), fa
lse); |
| 332 input.addEventListener('blur', this._validateControls.bind(this, false), fal
se); | 331 input.addEventListener('blur', this._validateControls.bind(this, false), fal
se); |
| 333 this._controlByName.set(name, input); | 332 this._controlByName.set(name, input); |
| 334 this._controls.push(input); | 333 this._controls.push(input); |
| 335 this._validators.push(validator); | 334 this._validators.push(validator); |
| 336 return input; | 335 return input; |
| 337 } | 336 } |
| 338 | 337 |
| 339 /** | 338 /** |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 412 |
| 414 _cancelClicked() { | 413 _cancelClicked() { |
| 415 var cancel = this._cancel; | 414 var cancel = this._cancel; |
| 416 this._commit = null; | 415 this._commit = null; |
| 417 this._cancel = null; | 416 this._cancel = null; |
| 418 this._item = null; | 417 this._item = null; |
| 419 this._index = -1; | 418 this._index = -1; |
| 420 cancel(); | 419 cancel(); |
| 421 } | 420 } |
| 422 }; | 421 }; |
| OLD | NEW |