LayoutManager: Zusammenfassung-Kachel registrieren + Layout-Migration
- zusammenfassung in DEFAULT_LAYOUT und TILE_MAP eingetragen - Toggle-Button funktioniert jetzt (Kachel ein-/ausblenden) - Migration: Gespeicherte Layouts ohne neue Kacheln werden automatisch ergaenzt (kein manueller Reset noetig)
Dieser Commit ist enthalten in:
@@ -10,7 +10,8 @@ const LayoutManager = {
|
|||||||
_hiddenTiles: {},
|
_hiddenTiles: {},
|
||||||
|
|
||||||
DEFAULT_LAYOUT: [
|
DEFAULT_LAYOUT: [
|
||||||
{ id: 'lagebild', x: 0, y: 0, w: 6, h: 4, minW: 4, minH: 4 },
|
{ id: 'zusammenfassung', x: 0, y: 0, w: 12, h: 2, minW: 4, minH: 2 },
|
||||||
|
{ id: 'lagebild', x: 0, y: 2, w: 6, h: 4, minW: 4, minH: 4 },
|
||||||
{ id: 'faktencheck', x: 6, y: 0, w: 6, h: 4, minW: 4, minH: 4 },
|
{ id: 'faktencheck', x: 6, y: 0, w: 6, h: 4, minW: 4, minH: 4 },
|
||||||
{ id: 'quellen', x: 0, y: 4, w: 12, h: 2, minW: 6, minH: 2 },
|
{ id: 'quellen', x: 0, y: 4, w: 12, h: 2, minW: 6, minH: 2 },
|
||||||
{ id: 'timeline', x: 0, y: 5, w: 12, h: 4, minW: 6, minH: 4 },
|
{ id: 'timeline', x: 0, y: 5, w: 12, h: 4, minW: 6, minH: 4 },
|
||||||
@@ -18,6 +19,7 @@ const LayoutManager = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
TILE_MAP: {
|
TILE_MAP: {
|
||||||
|
zusammenfassung: '#zusammenfassung-card',
|
||||||
lagebild: '.incident-analysis-summary',
|
lagebild: '.incident-analysis-summary',
|
||||||
faktencheck: '.incident-analysis-factcheck',
|
faktencheck: '.incident-analysis-factcheck',
|
||||||
quellen: '.source-overview-card',
|
quellen: '.source-overview-card',
|
||||||
@@ -43,6 +45,12 @@ const LayoutManager = {
|
|||||||
|
|
||||||
const saved = this._load();
|
const saved = this._load();
|
||||||
if (saved) {
|
if (saved) {
|
||||||
|
// Migration: Neue Kacheln ergaenzen die in alten Layouts fehlen
|
||||||
|
this.DEFAULT_LAYOUT.forEach(def => {
|
||||||
|
if (!saved.find(s => s.id === def.id)) {
|
||||||
|
saved.unshift({ id: def.id, x: def.x, y: def.y, w: def.w, h: def.h, visible: true });
|
||||||
|
}
|
||||||
|
});
|
||||||
this._applyLayout(saved);
|
this._applyLayout(saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren