From b700d1ae15e0a5380eaf7cc677a3abf17620d5d4 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sun, 22 Jan 2023 23:30:45 +1100 Subject: Replace ResizeObserver using width/height props For increasing compatibility with older devices --- src/App.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/App.vue') diff --git a/src/App.vue b/src/App.vue index e493433..20db479 100644 --- a/src/App.vue +++ b/src/App.vue @@ -33,13 +33,15 @@
- +
@@ -98,6 +100,14 @@ const store = useStore(); const contentWidth = ref(1); const contentHeight = ref(1); const vert = computed(() => contentHeight.value > contentWidth.value); +const timelineWidth = computed(() => { + let baseLineWidth = (store.showBaseLine && vert.value) ? store.baseLineBreadth : 0; + return (contentWidth.value - baseLineWidth) / (vert.value ? timelines.value.length : 1); +}); +const timelineHeight = computed(() => { + let baseLineHeight = (store.showBaseLine && !vert.value) ? store.baseLineBreadth : 0; + return (contentHeight.value - baseLineHeight) / (vert.value ? 1 : timelines.value.length); +}); function updateAreaDims(){ let contentAreaEl = contentAreaRef.value!; -- cgit v1.2.3