diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-05 18:28:35 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-05 18:28:35 -0400 |
| commit | 86f55d8aa12268fe847eaa344e8efbab5d293f34 (patch) | |
| tree | 6bbc5c6fb6825ef969ed0342e4851667b81577cc /src/client/views/animationtimeline/TimelineOverview.tsx | |
| parent | 2a9db784a6e3492a8f7d8ce9a745b4f1a0494241 (diff) | |
| parent | 139600ab7e8a82a31744cd3798247236cd5616fc (diff) | |
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/views/animationtimeline/TimelineOverview.tsx')
| -rw-r--r-- | src/client/views/animationtimeline/TimelineOverview.tsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/views/animationtimeline/TimelineOverview.tsx b/src/client/views/animationtimeline/TimelineOverview.tsx index 489c4dcde..7bf685c9e 100644 --- a/src/client/views/animationtimeline/TimelineOverview.tsx +++ b/src/client/views/animationtimeline/TimelineOverview.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/no-unused-prop-types */ import { action, IReactionDisposer, observable, reaction, runInAction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; @@ -32,7 +33,6 @@ export class TimelineOverview extends React.Component<TimelineOverviewProps> { @observable private visibleTime: number = 0; @observable private currentX: number = 0; @observable private visibleStart: number = 0; - private readonly DEFAULT_HEIGHT = 50; private readonly DEFAULT_WIDTH = 300; componentDidMount() { @@ -50,9 +50,9 @@ export class TimelineOverview extends React.Component<TimelineOverviewProps> { ); } - componentWillUnmount = () => { + componentWillUnmount() { this._authoringReaction && this._authoringReaction(); - }; + } @action setOverviewWidth() { @@ -109,7 +109,7 @@ export class TimelineOverview extends React.Component<TimelineOverviewProps> { e.preventDefault(); e.stopPropagation(); const scrubberRef = this._scrubberRef.current!; - const left = scrubberRef.getBoundingClientRect().left; + const { left } = scrubberRef.getBoundingClientRect(); const offsetX = Math.round(e.clientX - left); this.props.changeCurrentBarX((offsetX / this.activeOverviewWidth) * this.props.totalLength + this.props.currentBarX); }; @@ -152,17 +152,17 @@ export class TimelineOverview extends React.Component<TimelineOverviewProps> { const timeline = this.props.isAuthoring ? [ <div key="timeline-overview-container" className="timeline-overview-container overviewBar" id="timelineOverview" ref={this.authoringContainer}> - <div ref={this._visibleRef} key="1" className="timeline-overview-visible" style={{ left: `${barStart}px`, width: `${visibleBarWidth}px` }} onPointerDown={this.onPointerDown}></div>, + <div ref={this._visibleRef} key="1" className="timeline-overview-visible" style={{ left: `${barStart}px`, width: `${visibleBarWidth}px` }} onPointerDown={this.onPointerDown} />, <div ref={this._scrubberRef} key="2" className="timeline-overview-scrubber-container" style={{ left: `${scrubberStart}px` }} onPointerDown={this.onScrubberDown}> - <div key="timeline-overview-scrubber-head" className="timeline-overview-scrubber-head"></div> + <div key="timeline-overview-scrubber-head" className="timeline-overview-scrubber-head" /> </div> </div>, ] : [ <div key="1" className="timeline-play-bar overviewBar" id="timelinePlay" ref={this.playbackContainer}> - <div ref={this._scrubberRef} className="timeline-play-head" style={{ left: `${scrubberStart}px` }} onPointerDown={this.onScrubberDown}></div> + <div ref={this._scrubberRef} className="timeline-play-head" style={{ left: `${scrubberStart}px` }} onPointerDown={this.onScrubberDown} /> </div>, - <div key="2" className="timeline-play-tail" style={{ width: `${playWidth}px` }}></div>, + <div key="2" className="timeline-play-tail" style={{ width: `${playWidth}px` }} />, ]; return ( <div className="timeline-flex"> |
