Commit 5034647d authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

[NTP] Guard some RP functions with an if (configData.richerPicker)

This fixes a few bugs where new RP code was being run for the old
version of the menu.

Bug: 989426, 989405, 989403
Change-Id: I1b890064b2209eb9a91331b6a84433706193646a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728316Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682822}
parent 565d2f77
...@@ -905,6 +905,9 @@ customize.richerPicker_removeSelectedState = function(option) { ...@@ -905,6 +905,9 @@ customize.richerPicker_removeSelectedState = function(option) {
* @param {!Element} tile The tile that was selected. * @param {!Element} tile The tile that was selected.
*/ */
customize.richerPicker_previewImage = function(tile) { customize.richerPicker_previewImage = function(tile) {
if (!configData.richerPicker) {
return;
}
// Set preview images at 720p by replacing the params in the url. // Set preview images at 720p by replacing the params in the url.
const background = $(customize.IDS.CUSTOM_BG); const background = $(customize.IDS.CUSTOM_BG);
const preview = $(customize.IDS.CUSTOM_BG_PREVIEW); const preview = $(customize.IDS.CUSTOM_BG_PREVIEW);
...@@ -933,6 +936,9 @@ customize.richerPicker_previewImage = function(tile) { ...@@ -933,6 +936,9 @@ customize.richerPicker_previewImage = function(tile) {
* Remove a preview image of a custom backgrounds. * Remove a preview image of a custom backgrounds.
*/ */
customize.richerPicker_unpreviewImage = function() { customize.richerPicker_unpreviewImage = function() {
if (!configData.richerPicker) {
return;
}
const preview = $(customize.IDS.CUSTOM_BG_PREVIEW); const preview = $(customize.IDS.CUSTOM_BG_PREVIEW);
if (!preview.dataset || !preview.dataset.hasPreview) { if (!preview.dataset || !preview.dataset.hasPreview) {
return; return;
...@@ -1354,6 +1360,10 @@ customize.richerPicker_preselectShortcutOptions = function() { ...@@ -1354,6 +1360,10 @@ customize.richerPicker_preselectShortcutOptions = function() {
* background. * background.
*/ */
customize.richerPicker_preselectBackgroundOption = function() { customize.richerPicker_preselectBackgroundOption = function() {
if (!configData.richerPicker) {
return;
}
customize.preselectedOptions.backgroundsMenuTile = null; customize.preselectedOptions.backgroundsMenuTile = null;
const themeInfo = ntpApiHandle.themeBackgroundInfo; const themeInfo = ntpApiHandle.themeBackgroundInfo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment