File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 168168 }
169169
170170 .grid-stack-item-content {
171- overflow-x : hidden;
172- overflow-y : auto;
171+ xoverflow-x : hidden;
172+ xoverflow-y : auto;
173+ overflow : visible !important ;
173174 background : transparent !important ;
174175 box-shadow : none !important ;
175176 }
Original file line number Diff line number Diff line change @@ -85,10 +85,41 @@ async function resetDatabaseLayout() {
8585 }
8686}
8787
88+ function initAutoResizeForCard ( cardId ) {
89+
90+ const gridItem = document . getElementById ( cardId ) ;
91+ const content = gridItem . querySelector ( ".card" ) ;
92+
93+ if ( ! gridItem || ! content ) return ;
94+
95+ let resizeTimeout ;
96+
97+ const observer = new ResizeObserver ( ( ) => {
98+
99+ // kleines Debounce (wichtig wegen Chart.js Render-Zyklen)
100+ clearTimeout ( resizeTimeout ) ;
101+
102+ resizeTimeout = setTimeout ( ( ) => {
103+
104+ const newHeightPx = content . scrollHeight ;
105+
106+ const cellHeight = dashboardGrid . getCellHeight ( ) ;
107+ const newGridHeight = Math . ceil ( newHeightPx / cellHeight ) ;
108+
109+ dashboardGrid . update ( gridItem , { h : newGridHeight } ) ;
110+
111+ } , 80 ) ; // Sweet Spot
112+
113+ } ) ;
114+
115+ observer . observe ( content ) ;
116+ }
117+
88118document . addEventListener ( "DOMContentLoaded" , async ( ) => {
89119 // --- PHASE 1: Das Gerüst aufbauen ---
90120 initGridstack ( ) ;
91121 await loadLayout ( ) ; // Wartet, bis Boxen aus DB oder LocalStorage da sind
122+ initAutoResizeForCard ( "card-forecast" ) ;
92123
93124 // --- PHASE 2: Startwerte für Datumsfelder setzen ---
94125 const t = new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments