From 44cc010732b99be288e559c57e45a96fcc55c470 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Thu, 17 Mar 2022 13:36:43 +0100 Subject: [PATCH] foldable timeline --- src/components/time/Timeline.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/time/Timeline.js b/src/components/time/Timeline.js index 19dd63c..6581985 100644 --- a/src/components/time/Timeline.js +++ b/src/components/time/Timeline.js @@ -20,6 +20,7 @@ import Categories from "./Categories"; class Timeline extends React.Component { constructor(props) { super(props); + let searchParams = new URLSearchParams(window.location.href.split("?")[1]); this.styleDatetime = this.styleDatetime.bind(this); this.getDatetimeX = this.getDatetimeX.bind(this); this.getY = this.getY.bind(this); @@ -27,7 +28,7 @@ class Timeline extends React.Component { this.onSelect = this.onSelect.bind(this); this.svgRef = React.createRef(); this.state = { - isFolded: false, + isFolded: (searchParams.has('timeline') && searchParams.get('timeline') === 'false'), dims: props.dimensions, scaleX: null, scaleY: null,