clear QR Set color and bg adjustments

This commit is contained in:
LenAnderson
2024-07-14 14:13:57 -04:00
parent 7de5bd00be
commit ddce6c4e89
5 changed files with 64 additions and 18 deletions

View File

@ -84,8 +84,9 @@ export class QuickReplySet {
});
}
updateColor() {
if (this.color) {
if (this.color && this.color != 'transparent') {
this.dom.style.setProperty('--qr--color', this.color);
this.dom.classList.add('qr--color');
if (this.onlyBorderColor) {
this.dom.classList.add('qr--borderColor');
} else {
@ -93,6 +94,7 @@ export class QuickReplySet {
}
} else {
this.dom.style.setProperty('--qr--color', 'transparent');
this.dom.classList.remove('qr--color');
this.dom.classList.remove('qr--borderColor');
}
}

View File

@ -173,6 +173,13 @@ export class SettingsUi {
qrs.save();
this.currentQrSet.updateColor();
});
this.dom.querySelector('#qr--colorClear').addEventListener('click', (evt)=>{
const qrs = this.currentQrSet;
this.color.color = 'transparent';
qrs.color = 'transparent';
qrs.save();
this.currentQrSet.updateColor();
});
this.onlyBorderColor = this.dom.querySelector('#qr--onlyBorderColor');
this.onlyBorderColor.addEventListener('click', ()=>{
const qrs = this.currentQrSet;