This commit is contained in:
+10
-2
@@ -183,6 +183,7 @@
|
||||
function ensureInfoDialog() {
|
||||
let dialog = byId('info-dialog') || qs('#info-dialog');
|
||||
let title = byId('info-dialog-title') || qs('#info-dialog-title', dialog);
|
||||
let backButton = byId('info-back') || qs('#info-back', dialog);
|
||||
let closeButton = byId('info-close') || qs('#info-close', dialog);
|
||||
let content = qs('.info-dialog-content', dialog) || qs('.info-dialog-content');
|
||||
|
||||
@@ -232,6 +233,11 @@
|
||||
if (dialog) {
|
||||
setAttribute(dialog, 'aria-labelledby', 'info-dialog-title');
|
||||
}
|
||||
if (backButton) {
|
||||
setAttribute(backButton, 'type', 'button');
|
||||
setAttribute(backButton, 'aria-label', 'Zurück zum Informationsmenü');
|
||||
backButton.hidden = true;
|
||||
}
|
||||
if (closeButton) {
|
||||
setAttribute(closeButton, 'type', 'button');
|
||||
setAttribute(closeButton, 'aria-label', 'Informationsfenster schließen');
|
||||
@@ -242,7 +248,7 @@
|
||||
Object.keys(pageTitles).forEach(name => ensureInfoPage(content, name));
|
||||
}
|
||||
|
||||
return { dialog, title, closeButton, content };
|
||||
return { dialog, title, backButton, closeButton, content };
|
||||
}
|
||||
|
||||
function ensureInfoUi() {
|
||||
@@ -374,7 +380,8 @@
|
||||
if (toggle.dataset?.wegwichtelStorageBound === 'true') return;
|
||||
if (toggle.dataset) toggle.dataset.wegwichtelStorageBound = 'true';
|
||||
toggle.addEventListener('change', event => {
|
||||
const enabled = setProgressStorageEnabled(event.currentTarget.checked);
|
||||
const source = event.currentTarget || toggle;
|
||||
const enabled = setProgressStorageEnabled(Boolean(source.checked));
|
||||
syncStorageToggles();
|
||||
document.dispatchEvent(new CustomEvent('wegwichtel:progress-storage-changed', {
|
||||
detail: { enabled }
|
||||
@@ -386,6 +393,7 @@
|
||||
function bindDialog() {
|
||||
activate(elements?.infoButton, toggleDropdown);
|
||||
activate(elements?.closeButton, closeDialog);
|
||||
activate(elements?.backButton, () => setDropdownOpen(true));
|
||||
|
||||
qsa('[data-info-target]', elements?.dropdown).forEach(button => {
|
||||
activate(button, () => openDialog(button.dataset?.infoTarget));
|
||||
|
||||
Reference in New Issue
Block a user