diff --git a/src/static/js/app.js b/src/static/js/app.js index 4595db0..1ebd72c 100644 --- a/src/static/js/app.js +++ b/src/static/js/app.js @@ -960,6 +960,7 @@ const App = { const articleCount = entries.filter(e => e.kind === 'article').length; const snapshotCount = entries.filter(e => e.kind === 'snapshot').length; const countEl = document.getElementById('article-count'); + if (!countEl) return; if (articleCount > 0 && snapshotCount > 0) { countEl.innerHTML = ` ${articleCount} Meldung${articleCount !== 1 ? 'en' : ''} + ${snapshotCount} Lagebericht${snapshotCount !== 1 ? 'e' : ''}`; } else if (articleCount > 0) { @@ -978,7 +979,8 @@ const App = { rerenderTimeline() { const container = document.getElementById('timeline'); - const searchTerm = (document.getElementById('timeline-search').value || '').toLowerCase(); + if (!container) return; + const searchTerm = (document.getElementById('timeline-search')?.value || '').toLowerCase(); const filterType = this._timelineFilter; const range = this._timelineRange; diff --git a/src/static/js/layout.js b/src/static/js/layout.js index d5c980f..ba699c0 100644 --- a/src/static/js/layout.js +++ b/src/static/js/layout.js @@ -70,6 +70,15 @@ const LayoutManager = { if (item.visible === false) { this._hiddenTiles[item.id] = item; + // Card in tile-parking retten bevor Widget entfernt wird + const selector = this.TILE_MAP[item.id]; + if (selector) { + const cardEl = el.el.querySelector(selector); + if (cardEl) { + const parking = document.getElementById("tile-parking"); + if (parking) parking.appendChild(cardEl); + } + } this._grid.removeWidget(el.el, true, false); } else { this._grid.update(el.el, { x: item.x, y: item.y, w: item.w, h: item.h });