Commit 4e8f02d0 authored by Gayane Petrosyan's avatar Gayane Petrosyan Committed by Commit Bot

[Chrome Colors] Properly reset custom color picker.

When opening the color picker second time, it is init by
|customize.customColorPicked| and therefore selecting the same color
doesn't trigger color change event.

Reset |customize.customColorPicked| the same time when rest of the
color picker related values are reset.

Bug: 997120
Change-Id: I494c0a718c0389986de9014603b41754d0299ca5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769297Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Commit-Queue: Gayane Petrosyan <gayane@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690055}
parent 37eee550
...@@ -305,11 +305,17 @@ customize.preselectedOptions = { ...@@ -305,11 +305,17 @@ customize.preselectedOptions = {
customize.colorsMenuLoaded = false; customize.colorsMenuLoaded = false;
/**
* Default color for custom color picker in hex format.
* @type {string}
*/
customize.defaultCustomColor = '#000000';
/** /**
* Custom color picked in hex format. * Custom color picked in hex format.
* @type {string} * @type {string}
*/ */
customize.customColorPicked = '#000000'; customize.customColorPicked = customize.defaultCustomColor;
/** /**
* Sets the visibility of the settings menu and individual options depending on * Sets the visibility of the settings menu and individual options depending on
...@@ -2413,6 +2419,7 @@ customize.cancelColor = function() { ...@@ -2413,6 +2419,7 @@ customize.cancelColor = function() {
* picker. * picker.
*/ */
customize.resetColorsMenu = function() { customize.resetColorsMenu = function() {
customize.customColorPicked = customize.defaultCustomColor;
$(customize.IDS.COLOR_PICKER).value = null; $(customize.IDS.COLOR_PICKER).value = null;
$(customize.IDS.COLORS_MENU).style.setProperty('--custom-color-border', ''); $(customize.IDS.COLORS_MENU).style.setProperty('--custom-color-border', '');
$(customize.IDS.COLORS_MENU).style.setProperty('--custom-color-dark', ''); $(customize.IDS.COLORS_MENU).style.setProperty('--custom-color-dark', '');
......
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