This commit is contained in:
2026-01-16 02:34:44 +01:00
parent 4b917091bd
commit 9d33f15e19

View File

@@ -422,24 +422,7 @@ export function initEditor() {
  async function save() {
    if (!current?.id) return err('Keine aktive ID');
    const mode = activeMode();
    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 {}
    return delegateCommand('save-data');
  }
  // ... (Der Rest der Funktionen bleibt unverändert) ...