Skip to content

Commit 56613af

Browse files
Kobzols7tya
authored andcommitted
Make height calculation simpler
1 parent 58c92b5 commit 56613af

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

site/frontend/src/pages/graphs/page.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,8 @@ async function loadGraphData(selector: GraphsSelector, loading: Ref<boolean>) {
8585
// of the parent.
8686
const width = Math.floor(wrapperRef.value.clientWidth / columns) - 10;
8787
88-
const bodyEl = document.querySelector("body.container")!;
89-
const chartsEl = document.getElementById("charts")!;
90-
const height =
91-
countGraphs === 1
92-
? window.innerHeight - bodyEl.clientHeight + chartsEl.clientHeight - 60
93-
: 300;
88+
const top = wrapperRef.value.getBoundingClientRect().top;
89+
const height = countGraphs === 1 ? window.innerHeight - top - 100 : 300;
9490
9591
const opts = {
9692
width,

0 commit comments

Comments
 (0)