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

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

Issue 1783883002: Hide/Show the checkmark in the Wallpaper Picker grid when 'Surprise Me' is enabled/disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
index 982b45e20f9ca6eef895147e756d23d673416552..4fd4193845c363f8fcb4bc6eb307e027a8017073 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
@@ -334,12 +334,29 @@ chrome.storage.onChanged.addListener(function(changes, namespace) {
wpDocument.querySelector('#wallpaper-grid').classList.add('small');
if (wpDocument.querySelector('.check'))
wpDocument.querySelector('.check').style.visibility = 'hidden';
+ wpDocument.querySelector('#checkbox').classList.remove('checked');
+ wpDocument.querySelector('#categories-list').disabled = false;
+ wpDocument.querySelector('#wallpaper-grid').disabled = false;
});
} else {
wpDocument.querySelector('#wallpaper-set-by-message').textContent =
'';
wpDocument.querySelector('#wallpaper-grid').classList.remove('small');
- wpDocument.querySelector('.check').style.visibility = 'visible';
+ Constants.WallpaperSyncStorage.get(
+ Constants.AccessSyncSurpriseMeEnabledKey, function(item) {
+ var enable = item[Constants.AccessSyncSurpriseMeEnabledKey];
+ if (enable) {
+ wpDocument.querySelector('#checkbox').classList.add('checked');
+ if (wpDocument.querySelector('.check'))
+ wpDocument.querySelector('.check').style.visibility = 'hidden';
+ } else {
+ wpDocument.querySelector('#checkbox').classList.remove('checked');
+ if (wpDocument.querySelector('.check'))
+ wpDocument.querySelector('.check').style.visibility = 'visible';
+ }
+ wpDocument.querySelector('#categories-list').disabled = enable;
+ wpDocument.querySelector('#wallpaper-grid').disabled = enable;
+ });
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698