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 * |
| 13 * @param {HTMLElement} parentNode Node to be parent for this dialog. |
12 * @constructor | 14 * @constructor |
13 * @param {HTMLElement} parentNode Node to be parent for this dialog. | |
14 */ | 15 */ |
15 function SelectAlbumDialog(parentNode) { | 16 function SelectAlbumDialog(parentNode) { |
16 this.parentNode_ = parentNode; | 17 this.parentNode_ = parentNode; |
17 this.document_ = parentNode.ownerDocument; | 18 this.document_ = parentNode.ownerDocument; |
18 | 19 |
19 this.container_ = this.document_.createElement('div'); | 20 this.container_ = this.document_.createElement('div'); |
20 this.container_.className = 'select-album-dialog-container'; | 21 this.container_.className = 'select-album-dialog-container'; |
21 this.container_.addEventListener('keydown', | 22 this.container_.addEventListener('keydown', |
22 this.onContainerKeyDown_.bind(this)); | 23 this.onContainerKeyDown_.bind(this)); |
23 | 24 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 }; | 222 }; |
222 | 223 |
223 /** | 224 /** |
224 * Updates ok button. | 225 * Updates ok button. |
225 * @private | 226 * @private |
226 */ | 227 */ |
227 SelectAlbumDialog.prototype.updateOkButtonEnabled_ = function() { | 228 SelectAlbumDialog.prototype.updateOkButtonEnabled_ = function() { |
228 this.okButton_.disabled = this.selectionModel_.selectedIndex == 0 && | 229 this.okButton_.disabled = this.selectionModel_.selectedIndex == 0 && |
229 this.nameEdit_.value == ''; | 230 this.nameEdit_.value == ''; |
230 }; | 231 }; |
OLD | NEW |