aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2019-11-23 16:08:44 -0500
committerandrewdkim <adkim414@gmail.com>2019-11-23 16:08:44 -0500
commit8af45ed7f376981ce8f8b1c6d1b2fd3b1546a00e (patch)
tree1b559746b4c0a6cb177e09f06710c20203c5374a /src
parent5becac4b0442da73a6fe3b48e3a248f6cf2df61d (diff)
responsive update
Diffstat (limited to 'src')
-rw-r--r--src/client/views/animationtimeline/Timeline.tsx4
-rw-r--r--src/client/views/animationtimeline/Track.tsx4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx
index f8aa88755..64822542d 100644
--- a/src/client/views/animationtimeline/Timeline.tsx
+++ b/src/client/views/animationtimeline/Timeline.tsx
@@ -21,6 +21,7 @@ export class Timeline extends React.Component<FieldViewProps> {
private DEFAULT_CONTAINER_HEIGHT: number = 330;
private readonly DEFAULT_TICK_SPACING: number = 50;
+ private readonly MAX_TITLE_HEIGHT = 75;
private MIN_CONTAINER_HEIGHT: number = 205;
private readonly MAX_CONTAINER_HEIGHT: number = 800;
private readonly DEFAULT_TICK_INCREMENT: number = 1000;
@@ -61,7 +62,8 @@ export class Timeline extends React.Component<FieldViewProps> {
return Cast(this.props.Document[this.props.fieldKey], listSpec(Doc)) as List<Doc>;
}
componentWillMount() {
- this._titleHeight = window.innerHeight / 14; //arbitrary number, but for responsiveness
+ let relativeHeight = window.innerHeight / 14;
+ this._titleHeight = relativeHeight < this.MAX_TITLE_HEIGHT ? relativeHeight : this.MAX_TITLE_HEIGHT;
this.MIN_CONTAINER_HEIGHT = this._titleHeight + 130;
this.DEFAULT_CONTAINER_HEIGHT = this._titleHeight * 2 + 130;
}
diff --git a/src/client/views/animationtimeline/Track.tsx b/src/client/views/animationtimeline/Track.tsx
index bee9933b0..a3aa62a31 100644
--- a/src/client/views/animationtimeline/Track.tsx
+++ b/src/client/views/animationtimeline/Track.tsx
@@ -46,6 +46,7 @@ export class Track extends React.Component<IProps> {
"backgroundLayout",
"layout",
];
+ private readonly MAX_TITLE_HEIGHT = 75;
private _trackHeight = 0;
@computed private get regions() { return Cast(this.props.node.regions, listSpec(Doc)) as List<Doc>; }
@@ -53,7 +54,8 @@ export class Track extends React.Component<IProps> {
componentWillMount() {
runInAction(() => {
if (!this.props.node.regions) this.props.node.regions = new List<Doc>();
- this._trackHeight = window.innerHeight / 14; //for responsiveness
+ let relativeHeight = window.innerHeight / 14;
+ this._trackHeight = relativeHeight < this.MAX_TITLE_HEIGHT ? relativeHeight : this.MAX_TITLE_HEIGHT; //for responsiveness
});
}