better gantt vertical alignment

This commit is contained in:
STEINNI committed 2026-10-07 08:59:22 +00:00
1 parent 731d6cf55b
commit bb1e64218a
2 files changed
+11 -1

No files matched your search

+1 -1
View File
@@ -397,7 +397,7 @@ bz-gantt ul.tasks li{
bz-gantt.gantt bz-graflow{
position: absolute;
left: var(--chart-left);
top: calc(var(--row) + var(--bar-gap)); /* one header row (days grid) + bar centering gap */
top: calc(var(--chart-top, var(--row)) + var(--bar-gap)); /* first task row, measured in refresh(), plus bar centering gap */
right: 0;
bottom: 0;
width: auto; /* cancel the global bz-graflow 100vw/100vh defaults, */
+10
View File
@@ -194,6 +194,16 @@ class BZgantt extends Buildoz {
}
this.style.setProperty('--tasks-width', Math.ceil(maxWidth) + 'px')
const taskLis = [...this.ul.children].slice(1)
const row = parseFloat(getComputedStyle(this).getPropertyValue('--row')) || this.rowHeight || 25
if(taskLis[0] && taskLis[0].offsetHeight){
this.rowHeight = taskLis[1] ? (taskLis[1].offsetTop - taskLis[0].offsetTop) : taskLis[0].offsetHeight
this.style.setProperty('--chart-top', `${taskLis[0].offsetTop}px`)
} else {
this.rowHeight = row
this.style.setProperty('--chart-top', `${row}px`)
}
const [flow, firstDate, endIdx] = this.buildFlow()
let dayDate = new Date(firstDate)