mirror of
https://github.com/tutao/tutanota.git
synced 2025-10-19 07:53:47 +00:00
Fixes grid height
This commit is contained in:
parent
9a518eae42
commit
866879bf4c
1 changed files with 8 additions and 1 deletions
|
@ -67,6 +67,8 @@ const BASE_EVENT_BUBBLE_SPAN_SIZE = 1
|
||||||
|
|
||||||
export class TimeView implements Component<TimeViewAttributes> {
|
export class TimeView implements Component<TimeViewAttributes> {
|
||||||
private timeRowHeight?: number
|
private timeRowHeight?: number
|
||||||
|
private parentHeight?: number
|
||||||
|
|
||||||
private blockingGroupsCache: Map<Id, Array<Map<Id, boolean>>> = new Map()
|
private blockingGroupsCache: Map<Id, Array<Map<Id, boolean>>> = new Map()
|
||||||
private expandabilityCache: Map<Id, BlockingInfo> = new Map()
|
private expandabilityCache: Map<Id, BlockingInfo> = new Map()
|
||||||
private eventIdToOriginalColumnArrayIndex: Map<Id, number> = new Map()
|
private eventIdToOriginalColumnArrayIndex: Map<Id, number> = new Map()
|
||||||
|
@ -87,7 +89,9 @@ export class TimeView implements Component<TimeViewAttributes> {
|
||||||
oninit: (vnode: VnodeDOM) => {
|
oninit: (vnode: VnodeDOM) => {
|
||||||
if (this.timeRowHeight == null) {
|
if (this.timeRowHeight == null) {
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
this.timeRowHeight = Number.parseFloat(window.getComputedStyle(vnode.dom).height.replaceAll("px", "")) / subRowCount
|
const domHeight = Number.parseFloat(window.getComputedStyle(vnode.dom).height.replace("px", ""))
|
||||||
|
this.timeRowHeight = domHeight / subRowCount
|
||||||
|
this.parentHeight = domHeight
|
||||||
m.redraw()
|
m.redraw()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -99,6 +103,9 @@ export class TimeView implements Component<TimeViewAttributes> {
|
||||||
return m(
|
return m(
|
||||||
".grid.plr-unit.gap.z1.grid-auto-columns.rel.border-right",
|
".grid.plr-unit.gap.z1.grid-auto-columns.rel.border-right",
|
||||||
{
|
{
|
||||||
|
style: {
|
||||||
|
height: this.parentHeight ? px(this.parentHeight) : undefined,
|
||||||
|
},
|
||||||
oncreate(vnode): any {
|
oncreate(vnode): any {
|
||||||
;(vnode.dom as HTMLElement).style.gridTemplateRows = `repeat(${subRowCount}, 1fr)`
|
;(vnode.dom as HTMLElement).style.gridTemplateRows = `repeat(${subRowCount}, 1fr)`
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue