| 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('options', function() { | 5 cr.define('options', function() { |
| 6 | 6 |
| 7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
| 8 var UserImagesGrid = options.UserImagesGrid; | 8 var UserImagesGrid = options.UserImagesGrid; |
| 9 | 9 |
| 10 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 OptionsPage.closeOverlay(); | 104 OptionsPage.closeOverlay(); |
| 105 }, | 105 }, |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * Selects user image with the given index. | 108 * Selects user image with the given index. |
| 109 * @param {int} index index of the image to select. | 109 * @param {int} index index of the image to select. |
| 110 * @private | 110 * @private |
| 111 */ | 111 */ |
| 112 setSelectedImage_: function(index) { | 112 setSelectedImage_: function(index) { |
| 113 var wallpaperGrid = $('wallpaper-grid'); | 113 var wallpaperGrid = $('wallpaper-grid'); |
| 114 wallpaperGrid.selectionModel.selectedIndex = index; | 114 wallpaperGrid.selectedItemIndex = index; |
| 115 wallpaperGrid.selectionModel.leadIndex = index; | |
| 116 $('author-name').innerText = this.wallpapers_[index].author; | 115 $('author-name').innerText = this.wallpapers_[index].author; |
| 117 $('author-website').innerText = this.wallpapers_[index].website; | 116 $('author-website').innerText = this.wallpapers_[index].website; |
| 118 }, | 117 }, |
| 119 | 118 |
| 120 /** | 119 /** |
| 121 * Appends default images to the image grid. Should only be called once. | 120 * Appends default images to the image grid. Should only be called once. |
| 122 * @param {Array.<{author: string, url: string, website: string}>} | 121 * @param {Array.<{author: string, url: string, website: string}>} |
| 123 * wallpapers An array of wallpaper objects. | 122 * wallpapers An array of wallpaper objects. |
| 124 * @private | 123 * @private |
| 125 */ | 124 */ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 148 }; | 147 }; |
| 149 }); | 148 }); |
| 150 | 149 |
| 151 // Export | 150 // Export |
| 152 return { | 151 return { |
| 153 SetWallpaperOptions: SetWallpaperOptions | 152 SetWallpaperOptions: SetWallpaperOptions |
| 154 }; | 153 }; |
| 155 | 154 |
| 156 }); | 155 }); |
| 157 | 156 |
| OLD | NEW |