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

Unified Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js

Issue 14244011: Fix custom wallpaper going back from wallpaper 2 to wallpaper 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
index 35a0d99103cf1f581303f646577c46265264ef19..e71a44a600eac9b8580942d299e532c9c9e55d6b 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
@@ -247,6 +247,22 @@ cr.define('wallpapers', function() {
},
/**
+ * Inserts newElement at the position specified by index.
+ * @param {number} index The index of the newElement to insert.
+ * @type {!Object} Wallpaper information inserted into the data model.
flackr 2013/04/15 15:02:02 @param {!Object} newElement Although I'd prefer th
bshe 2013/04/15 15:22:10 Done.
+ */
+ insertElement: function(index, newElement) {
+ // splice may dispatch a change event because the position of selected
+ // element changing. But the actual selected element didn't change after
+ // splice. Sets inProgramSelection to true to disable the event handler of
+ // change event. Otherwise, wallpaper may reset to previous one as
flackr 2013/04/15 15:02:02 Can we not we prevent handling a change event whic
bshe 2013/04/15 15:22:10 Sorry, just to confirm. Do you mean we check if th
flackr 2013/04/15 20:00:54 Yes. On 2013/04/15 15:22:10, bshe wrote:
bshe 2013/04/15 23:38:22 Done.
+ // described in http://crbug.com/229036.
+ this.inProgramSelection_ = true;
+ this.dataModel.splice(index, 0, newElement);
+ this.inProgramSelection_ = false;
+ },
+
+ /**
* Forces re-display, size re-calculation and focuses grid.
*/
updateAndFocus: function() {
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698