From 3cf59bf6dc15e85fa00d881deb11658c2fee70ee Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 10 Jan 2022 19:40:28 +0100 Subject: [PATCH] =?UTF-8?q?Dodano=20animacj=C4=99=20rozwijania=20listy=20h?= =?UTF-8?q?istorii=20dy=C5=BCurnych?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SceneryView/SceneryHistory.vue | 66 +++++++++++++++---- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/src/components/SceneryView/SceneryHistory.vue b/src/components/SceneryView/SceneryHistory.vue index 2e43f34..ad397dd 100644 --- a/src/components/SceneryView/SceneryHistory.vue +++ b/src/components/SceneryView/SceneryHistory.vue @@ -21,19 +21,23 @@ > {{ timeline.date }} arrow - - -
- - - {{ timestampToString(dispatcher.dispatcherFrom, true) }} + + +
+
+ + + {{ timestampToString(dispatcher.dispatcherFrom, true) }} + + > + + {{ timestampToString(dispatcher.dispatcherTo, true) }} - > - {{ timestampToString(dispatcher.dispatcherTo, true) }} - - {{ dispatcher.dispatcherName }} + {{ dispatcher.dispatcherName }} +
-
+ @@ -131,6 +135,30 @@ export default defineComponent({ this.dispatcherTimeline[index].showTimeline = !this.dispatcherTimeline[index].showTimeline; }, + enter(el: HTMLElement) { + const maxHeight = getComputedStyle(el).height; + + el.style.height = '0px'; + + getComputedStyle(el); + + setTimeout(() => { + el.style.height = maxHeight; + }, 10); + }, + + afterEnter(el: HTMLElement) { + el.style.height = 'auto'; + }, + + leave(el: HTMLElement) { + el.style.height = getComputedStyle(el).height; + + setTimeout(() => { + el.style.height = '0px'; + }, 10); + }, + timestampToString: (timestamp: number, timeOnly = false): string => new Date(timestamp).toLocaleTimeString('pl-PL', { day: timeOnly ? undefined : '2-digit', @@ -144,6 +172,14 @@ export default defineComponent({