mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 15:21:22 +02:00
fix: load autosave-handler.js on about_page edit view, persist contact group deletion
Two fixes: 1. about_page edit was missing autosave-handler.js: the first if block (editType === 'page' || 'about_page') overrode $extraJs with only overtype.min.js, making the elseif that added autosave-handler.js unreachable for about_page. Added autosave-handler.js to the first block, removed dead 'about_page' from the elseif. 2. Deleting a contact group (Contacts 3/4/5) only removed the DOM element but never triggered htmx autosave. Dispatched a 'change' event on the form after removal+reindex so the hx-trigger fires. Also expanded autosave-handler.js URL filter to accept apropos.php so the status indicator (Enregistrement/Enregistré) works for contacts saves.
This commit is contained in:
@@ -83,7 +83,7 @@ $extraJsInline = '';
|
||||
|
||||
if ($editType === 'page' || $editType === 'about_page') {
|
||||
$initialContent = $page["content"] ?? "";
|
||||
$extraJs = ["/assets/js/vendor/overtype.min.js"];
|
||||
$extraJs = ["/assets/js/vendor/overtype.min.js", "/assets/js/app/autosave-handler.js"];
|
||||
$extraJsInline = <<<'JS'
|
||||
var OT = window.OverType.default || window.OverType;
|
||||
var hidden = document.getElementById('content');
|
||||
@@ -113,7 +113,7 @@ var editor = new OT(document.getElementById('editor'), {
|
||||
}
|
||||
});
|
||||
JS;
|
||||
} elseif ($editType === 'apropos' || $editType === 'about_page') {
|
||||
} elseif ($editType === 'apropos') {
|
||||
$extraJs = ["/assets/js/app/autosave-handler.js"];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user