fix toolcool color picker some more

This commit is contained in:
LenAnderson
2024-07-16 15:39:07 -04:00
parent 2a9ba4aec4
commit cda920df08

View File

@ -168,7 +168,9 @@ export class SettingsUi {
}); });
let initialColorChange = true; let initialColorChange = true;
this.color = this.dom.querySelector('#qr--color'); this.color = this.dom.querySelector('#qr--color');
this.color.color = this.currentQrSet?.color ?? 'transparent';
this.color.addEventListener('change', (evt)=>{ this.color.addEventListener('change', (evt)=>{
if (!this.dom.closest('body')) return;
const qrs = this.currentQrSet; const qrs = this.currentQrSet;
if (initialColorChange) { if (initialColorChange) {
initialColorChange = false; initialColorChange = false;
@ -182,7 +184,6 @@ export class SettingsUi {
this.dom.querySelector('#qr--colorClear').addEventListener('click', (evt)=>{ this.dom.querySelector('#qr--colorClear').addEventListener('click', (evt)=>{
const qrs = this.currentQrSet; const qrs = this.currentQrSet;
this.color.color = 'transparent'; this.color.color = 'transparent';
qrs.color = 'transparent';
qrs.save(); qrs.save();
this.currentQrSet.updateColor(); this.currentQrSet.updateColor();
}); });
@ -200,7 +201,7 @@ export class SettingsUi {
this.disableSend.checked = this.currentQrSet.disableSend; this.disableSend.checked = this.currentQrSet.disableSend;
this.placeBeforeInput.checked = this.currentQrSet.placeBeforeInput; this.placeBeforeInput.checked = this.currentQrSet.placeBeforeInput;
this.injectInput.checked = this.currentQrSet.injectInput; this.injectInput.checked = this.currentQrSet.injectInput;
// this.color.color = this.currentQrSet.color ?? 'transparent'; this.color.color = this.currentQrSet.color ?? 'transparent';
this.onlyBorderColor.checked = this.currentQrSet.onlyBorderColor; this.onlyBorderColor.checked = this.currentQrSet.onlyBorderColor;
this.qrList.innerHTML = ''; this.qrList.innerHTML = '';
const qrsDom = this.currentQrSet.renderSettings(); const qrsDom = this.currentQrSet.renderSettings();