| 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 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 new ThumbnailLoader(item.url).load(box, ThumbnailLoader.FillMode.FILL); | 113 new ThumbnailLoader(item.url).load(box, ThumbnailLoader.FillMode.FILL); |
| 114 | 114 |
| 115 return result; | 115 return result; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * Shows dialog. | 119 * Shows dialog. |
| 120 * | 120 * |
| 121 * @param {string} message Message in dialog caption. | 121 * @param {string} message Message in dialog caption. |
| 122 * @param {Array} items Albums to render in list | 122 * @param {Array} items Albums to render in list. |
| 123 * @param {string} defaultNewName Default name of the new album. | 123 * @param {string} defaultNewName Default name of the new album. |
| 124 * @param {string} okCaption Text on the ok button. | 124 * @param {string} okCaption Text on the ok button. |
| 125 * @param {function} onOk Callback function. | 125 * @param {function} onOk Callback function. |
| 126 */ | 126 */ |
| 127 SelectAlbumDialog.prototype.show = function( | 127 SelectAlbumDialog.prototype.show = function( |
| 128 message, items, defaultNewName, okCaption, onOk) { | 128 message, items, defaultNewName, okCaption, onOk) { |
| 129 | 129 |
| 130 this.onOk_ = onOk; | 130 this.onOk_ = onOk; |
| 131 this.okButton_.textContent = okCaption; | 131 this.okButton_.textContent = okCaption; |
| 132 this.caption_.textContent = message; | 132 this.caption_.textContent = message; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 /** | 222 /** |
| 223 * Updates ok button. | 223 * Updates ok button. |
| 224 * @private | 224 * @private |
| 225 */ | 225 */ |
| 226 SelectAlbumDialog.prototype.updateOkButtonEnabled_ = function() { | 226 SelectAlbumDialog.prototype.updateOkButtonEnabled_ = function() { |
| 227 this.okButton_.disabled = this.selectionModel_.selectedIndex == 0 && | 227 this.okButton_.disabled = this.selectionModel_.selectedIndex == 0 && |
| 228 this.nameEdit_.value == ''; | 228 this.nameEdit_.value == ''; |
| 229 }; | 229 }; |
| OLD | NEW |