sdadsa
This commit is contained in:
@@ -422,24 +422,7 @@ export function initEditor() {
|
|||||||
async function save() {
|
async function save() {
|
||||||
if (!current?.id) return err('Keine aktive ID');
|
if (!current?.id) return err('Keine aktive ID');
|
||||||
|
|
||||||
const mode = activeMode();
|
return delegateCommand('save-data');
|
||||||
if (mode !== 'snippets') { // Nur Templates/Blocks/Sections delegieren, Snippets behalten die alte Logik (NUR HTML)
|
|
||||||
return delegateCommand('save-data');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Alte Snippet-Logik beibehalten (falls der Snippet-Editor nicht GrapesJS ist und nur HTML erwartet)
|
|
||||||
const liveHtml = await readEditedHtml();
|
|
||||||
|
|
||||||
const payload = { id: current.id, content: liveHtml };
|
|
||||||
|
|
||||||
const res = await apiUpdate(mode, current.id, payload);
|
|
||||||
if (!res?.ok) { err('Speichern fehlgeschlagen'); return; }
|
|
||||||
|
|
||||||
ok('Gespeichert');
|
|
||||||
try {
|
|
||||||
if (typeof window.reloadActiveList === 'function') await window.reloadActiveList();
|
|
||||||
else if (typeof window.__reloadList === 'function') window.__reloadList(mode);
|
|
||||||
} catch {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... (Der Rest der Funktionen bleibt unverändert) ...
|
// ... (Der Rest der Funktionen bleibt unverändert) ...
|
||||||
|
|||||||
Reference in New Issue
Block a user