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 | 5 |
6 /** | 6 /** |
7 * SelectAlbumDialog contains a message, a list box, an ok button, and a | 7 * SelectAlbumDialog contains a message, a list box, an ok button, and a |
8 * cancel button. | 8 * cancel button. |
9 * Operates on a list of objects representing albums: { name, url, create }. | 9 * Operates on a list of objects representing albums: { name, url, create }. |
10 * If user chooses to create a new album, result will be a fake album with | 10 * If user chooses to create a new album, result will be a fake album with |
11 * |create == true|. | 11 * |create == true|. |
| 12 * @constructor |
12 * @param {HTMLElement} parentNode Node to be parent for this dialog. | 13 * @param {HTMLElement} parentNode Node to be parent for this dialog. |
13 */ | 14 */ |
14 function SelectAlbumDialog(parentNode) { | 15 function SelectAlbumDialog(parentNode) { |
15 this.parentNode_ = parentNode; | 16 this.parentNode_ = parentNode; |
16 this.document_ = parentNode.ownerDocument; | 17 this.document_ = parentNode.ownerDocument; |
17 | 18 |
18 this.container_ = this.document_.createElement('div'); | 19 this.container_ = this.document_.createElement('div'); |
19 this.container_.className = 'select-album-dialog-container'; | 20 this.container_.className = 'select-album-dialog-container'; |
20 this.container_.addEventListener('keydown', | 21 this.container_.addEventListener('keydown', |
21 this.onContainerKeyDown_.bind(this)); | 22 this.onContainerKeyDown_.bind(this)); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 }; | 221 }; |
221 | 222 |
222 /** | 223 /** |
223 * Updates ok button. | 224 * Updates ok button. |
224 * @private | 225 * @private |
225 */ | 226 */ |
226 SelectAlbumDialog.prototype.updateOkButtonEnabled_ = function() { | 227 SelectAlbumDialog.prototype.updateOkButtonEnabled_ = function() { |
227 this.okButton_.disabled = this.selectionModel_.selectedIndex == 0 && | 228 this.okButton_.disabled = this.selectionModel_.selectedIndex == 0 && |
228 this.nameEdit_.value == ''; | 229 this.nameEdit_.value == ''; |
229 }; | 230 }; |
OLD | NEW |