fix: 🐛 Cookie Modal list 'toggleCookie' was using wrong HTMLElement
This commit is contained in:
parent
4f2a845dd4
commit
998da390ac
1 changed files with 6 additions and 14 deletions
|
|
@ -748,29 +748,21 @@ export default class CookieNotice {
|
|||
cnSwitch.setAttribute("aria-labelledby", `${cookieName}-desc`);
|
||||
cnSwitch.setAttribute("aria-describedby", `${cookieName}-desc`);
|
||||
|
||||
const toggleCookie = () => {
|
||||
const toggleCookie = (activate:boolean) => {
|
||||
this.setCookieStatus(
|
||||
cookieName,
|
||||
cnSwitch.checked ? CookieStatus.true : CookieStatus.false,
|
||||
activate ? CookieStatus.true : CookieStatus.false,
|
||||
cookieConfig
|
||||
);
|
||||
};
|
||||
this.addEvent(cnSwitch, "click", () => {
|
||||
toggleCookie();
|
||||
if (cnSwitchInput.checked) {
|
||||
cnSwitch.ariaChecked = "true";
|
||||
} else {
|
||||
cnSwitch.ariaChecked = "false";
|
||||
}
|
||||
toggleCookie(cnSwitchInput.checked);
|
||||
cnSwitch.ariaChecked = cnSwitchInput.checked ? "true" : "false";
|
||||
});
|
||||
this.addEventKbdValidate(cnSwitch, () => {
|
||||
toggleCookie();
|
||||
toggleCookie(cnSwitchInput.checked);
|
||||
cnSwitchInput.checked = !cnSwitchInput.checked;
|
||||
if (cnSwitchInput.checked) {
|
||||
cnSwitch.ariaChecked = "true";
|
||||
} else {
|
||||
cnSwitch.ariaChecked = "false";
|
||||
}
|
||||
cnSwitch.ariaChecked = cnSwitchInput.checked ? "true" : "false";
|
||||
});
|
||||
|
||||
this.cookiesUnorderedList.append(cookie);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue