asdds
All checks were successful
Deploy / deploy-staging (push) Successful in 26s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-24 23:50:41 +02:00
parent d121f74bd0
commit 46111d8988
4 changed files with 231 additions and 18 deletions

View File

@@ -22,6 +22,38 @@
};
const bindInteractions = (host, loadRoute) => {
host.querySelectorAll('[data-cm-edit-toggle]').forEach((button) => {
if (button.dataset.cmBound === '1') {
return;
}
button.dataset.cmBound = '1';
button.addEventListener('click', () => {
const targetId = String(button.getAttribute('data-cm-edit-toggle') || '');
const target = targetId !== '' ? host.querySelector(`[data-cm-edit-target="${CSS.escape(targetId)}"]`) : null;
if (!(target instanceof HTMLElement)) {
return;
}
target.hidden = !target.hidden;
});
});
host.querySelectorAll('[data-cm-edit-close]').forEach((button) => {
if (button.dataset.cmBound === '1') {
return;
}
button.dataset.cmBound = '1';
button.addEventListener('click', () => {
const targetId = String(button.getAttribute('data-cm-edit-close') || '');
const target = targetId !== '' ? host.querySelector(`[data-cm-edit-target="${CSS.escape(targetId)}"]`) : null;
if (target instanceof HTMLElement) {
target.hidden = true;
}
});
});
host.querySelectorAll('form[action]').forEach((form) => {
if (form.dataset.cmBound === '1') {
return;