feat: Farbschemata nachträglich bearbeiten

Neuer Button 'Schema bearbeiten' neben 'Schema löschen'. Öffnet das
bestehende Modal mit vorausgefüllten Daten (Name, Farben, Vorschaubild).
Umbenennen wird korrekt behandelt (altes Schema wird ersetzt).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ferdinand
2026-04-02 15:04:54 +02:00
parent 405f1f25d7
commit 8a31d5336e
4 changed files with 60 additions and 9 deletions

View File

@@ -1,8 +1,8 @@
import { initEingabe } from './eingabe.js';
import { initPicker } from './picker.js';
import { initHarmonien } from './harmonien.js';
import { addFavorit, addColorToSchema, addToHistory, renderSammlung, exportCollection, importCollection, saveSchema } from './collection.js';
import { initSchemaModal } from './schema-modal.js';
import { addFavorit, addColorToSchema, addToHistory, renderSammlung, exportCollection, importCollection, saveSchema, setEditSchemaHandler } from './collection.js';
import { initSchemaModal, openForEdit } from './schema-modal.js';
// state.color is read-only from outside — always use setColor() to update,
// so that the colorChanged event is dispatched to all listening modules.
@@ -39,3 +39,4 @@ document.getElementById('sammlung-import-btn').addEventListener('click', importC
renderSammlung();
initSchemaModal(saveSchema);
setEditSchemaHandler(openForEdit);