diff --git a/popup/popup.js b/popup/popup.js index 99149ed..077cfd5 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -33,7 +33,7 @@ el.style.backgroundColor = val; } - function openPickerForSwatch(swatchEl) { + function openPickerForSwatch(swatchEl, onBeforeChange) { if (!picker) { picker = window.RedditTweaks.colorPicker.create(); } @@ -50,6 +50,7 @@ picker.open(getColorValue(swatchEl), function (hex) { setColorValue(swatchEl, hex); + if (onBeforeChange) onBeforeChange(); saveFromControls(); }); } @@ -161,7 +162,9 @@ [bgSwatch, borderSwatch, textSwatch].forEach(function (swatch) { swatch.addEventListener("click", function () { - openPickerForSwatch(swatch); + openPickerForSwatch(swatch, function () { + entry._dirtyModes[modeSelect.value] = true; + }); }); });