diff options
-rw-r--r-- | src/client/views/animationtimeline/Timeline.tsx | 4 | ||||
-rw-r--r-- | src/client/views/animationtimeline/Track.tsx | 4 |
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 }); } |