From 0ddb299f256a6be037a904b84c4b2cdcdffe18c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 3 Oct 2021 00:48:04 +0200 Subject: Fix graphical block size. --- static/globals.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'static') diff --git a/static/globals.js b/static/globals.js index c414fc5b..6efba94f 100644 --- a/static/globals.js +++ b/static/globals.js @@ -324,6 +324,21 @@ class ComponentBlock extends ComponentVEvent { constructor () { super(); } + + redraw (data) { + super.redraw(data); + + let p; + if ((p = data.getProperty('dtstart'))) { + this.style.top = date_to_percent(p, 1) + "%"; + console.log('dtstart', p); + } + if ((p = data.getProperty('dtend'))) { + this.style.height = 'unset'; + console.log('dtend', p); + this.style.bottom = (100 - date_to_percent(p, 1)) + "%"; + } + } } window.addEventListener('load', function () { -- cgit v1.2.3