Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: chrome/browser/resources/options2/chromeos/set_wallpaper_options.js

Issue 9856016: Using random wallpaper until user select one (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge and Fix license header Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/chromeos/user_images_grid.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/user_images_grid.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698