Skip to content

Commit f66eec3

Browse files
author
jacquesbach
committed
Card Resize changes
1 parent bcc46b6 commit f66eec3

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

static/js/layout.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ function initAutoResizeForCard(cardId) {
115115
observer.observe(content);
116116
}
117117

118+
function forceGridResize(cardId) {
119+
const gridItem = document.getElementById(cardId);
120+
const content = gridItem.querySelector(".card");
121+
122+
if (!gridItem || !content) return;
123+
124+
const newHeightPx = content.scrollHeight;
125+
const cellHeight = dashboardGrid.getCellHeight();
126+
const newGridHeight = Math.ceil(newHeightPx / cellHeight);
127+
128+
dashboardGrid.update(gridItem, { h: newGridHeight });
129+
}
130+
118131
document.addEventListener("DOMContentLoaded", async () => {
119132
// --- PHASE 1: Das Gerüst aufbauen ---
120133
initGridstack();

static/js/script.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,11 @@ async function loadForecast() {
11401140
showShapDetails(forecast[index]);
11411141
}
11421142
}
1143+
animation: {
1144+
onComplete: () => {
1145+
forceGridResize("card-forecast");
1146+
}
1147+
}
11431148
}
11441149
});
11451150
}
@@ -1171,6 +1176,11 @@ async function loadFeatureImportance() {
11711176
display: false
11721177
}
11731178
}
1179+
animation: {
1180+
onComplete: () => {
1181+
forceGridResize("card-forecast");
1182+
}
1183+
}
11741184
}
11751185
});
11761186

@@ -1209,6 +1219,11 @@ async function loadGlobalShap() {
12091219
display: false
12101220
}
12111221
}
1222+
animation: {
1223+
onComplete: () => {
1224+
forceGridResize("card-forecast");
1225+
}
1226+
}
12121227
}
12131228
});
12141229

0 commit comments

Comments
 (0)