diff --git a/src/static/js/app.js b/src/static/js/app.js index a5d433d..e503869 100644 --- a/src/static/js/app.js +++ b/src/static/js/app.js @@ -632,22 +632,24 @@ const App = { this.closeRefreshHistory(); this.currentIncidentId = id; localStorage.setItem('selectedIncidentId', id); - // SR-Announcement - // Scroll komplett blockieren bevor irgendetwas gerendert wird - var mc = document.getElementById("main-content"); - mc.style.overflow = "hidden"; - mc.scrollTop = 0; const inc = this.incidents.find(i => i.id === id); if (inc) this._announceForSR('Lage ausgewählt: ' + inc.title); this.renderSidebar(); + var mc = document.getElementById("main-content"); + mc.scrollTop = 0; + document.getElementById('empty-state').style.display = 'none'; document.getElementById('incident-view').style.display = 'flex'; + // GridStack-Animation temporaer deaktivieren um Scroll-Sprung zu verhindern + var gridEl = document.querySelector('.grid-stack'); + if (gridEl) gridEl.classList.remove('grid-stack-animate'); + // gridstack-Layout initialisieren (einmalig) if (typeof LayoutManager !== 'undefined') LayoutManager.init(); - // Refresh-Status für diese Lage wiederherstellen + // Refresh-Status fuer diese Lage wiederherstellen const isRefreshing = this._refreshingIncidents.has(id); this._updateRefreshButton(isRefreshing); if (isRefreshing) { @@ -656,10 +658,14 @@ const App = { UI.hideProgress(); } - mc.scrollTop = 0; await this.loadIncidentDetail(id); + + // Zum Header scrollen und Animation wieder aktivieren mc.scrollTop = 0; - setTimeout(() => { mc.scrollTop = 0; mc.style.overflow = ""; }, 500); + requestAnimationFrame(() => { + mc.scrollTop = 0; + if (gridEl) gridEl.classList.add('grid-stack-animate'); + });