Commit 89a88429 authored by Gayane Petrosyan's avatar Gayane Petrosyan Committed by Commit Bot

[Chrome Colors] Update color picker value only on open.

No need to update color picker value while its open. As theme updates
have latency, it only creates unsmooth behavior as theme updates try to
update the color picker color while sliding over the color spectrum.

Bug: 990379
Change-Id: I6feaabee66ecbbc15b70b26037224a8655c69f1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1749424Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Commit-Queue: Gayane Petrosyan <gayane@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686557}
parent b63f3349
......@@ -304,6 +304,13 @@ customize.preselectedOptions = {
*/
customize.colorsMenuLoaded = false;
/**
* Custom color picked in hex format.
* @type {string}
*/
customize.customColorPicked = '#000000';
/**
* Sets the visibility of the settings menu and individual options depending on
* their respective features.
......@@ -2259,6 +2266,7 @@ customize.loadColorsMenu = function() {
// Configure custom color picker.
if (configData.chromeColorsCustomColorPicker) {
$(customize.IDS.COLOR_PICKER_TILE).onclick = function(event) {
$(customize.IDS.COLOR_PICKER).value = customize.customColorPicked;
$(customize.IDS.COLOR_PICKER).click();
};
$(customize.IDS.COLOR_PICKER_TILE).onkeydown =
......@@ -2321,8 +2329,7 @@ customize.colorsMenuPreselectTile = function() {
tile = $(customize.IDS.COLOR_PICKER_TILE);
// Update color picker tile colors.
$(customize.IDS.COLOR_PICKER).value =
colorArrayToHex(themeInfo.colorPicked);
customize.customColorPicked = colorArrayToHex(themeInfo.colorPicked);
$(customize.IDS.COLORS_MENU)
.style.setProperty(
'--custom-color-border', colorArrayToHex(themeInfo.colorDark));
......
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