diff options
| author | andrewdkim <adkim414@gmail.com> | 2019-07-11 13:00:52 -0400 |
|---|---|---|
| committer | andrewdkim <adkim414@gmail.com> | 2019-07-11 13:00:52 -0400 |
| commit | c206384e34ea22dfdfe05a873531b7710c88d1c3 (patch) | |
| tree | 184469f0b8435a5223901a9bbf15895ac1d4477b /src/client/views/nodes/Timeline.tsx | |
| parent | 918b0567a071e4fcb61c2afed676c850f8616e89 (diff) | |
interpolation and for demo
Diffstat (limited to 'src/client/views/nodes/Timeline.tsx')
| -rw-r--r-- | src/client/views/nodes/Timeline.tsx | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/client/views/nodes/Timeline.tsx b/src/client/views/nodes/Timeline.tsx index d25aa7953..7076e21ab 100644 --- a/src/client/views/nodes/Timeline.tsx +++ b/src/client/views/nodes/Timeline.tsx @@ -62,12 +62,8 @@ export class Timeline extends CollectionSubView(Document) { @observable private flyoutInfo: FlyoutProps = { x: 0, y: 0, display: "none", regiondata: new Doc(), regions: new List<Doc>() }; private block = false; - - componentDidMount() { - this.initialize(); - } - - componentWillMount() { + componentWillMount() { + console.log(this._ticks.length ); runInAction(() => { //check if this is a video frame for (let i = 0; i < this._time;) { @@ -76,16 +72,30 @@ export class Timeline extends CollectionSubView(Document) { } }); } + componentDidMount() { + runInAction(() => {let children = Cast(this.props.Document[this.props.fieldKey], listSpec(Doc)); + if (!children) { + return; + } + let childrenList = ((children[Self] as any).__fields) as List<Doc>; + this._nodes = (childrenList) as List<Doc>; + }); + this.initialize(); + } + + + + componentDidUpdate() { + runInAction(() => this._time = 100001); + } + componentWillUnmount() { + document.removeEventListener("pointerdown", this.closeFlyout); + } initialize = action(() => { let scrubber = this._scrubberbox.current!; this._boxLength = scrubber.getBoundingClientRect().width; - let children = Cast(this.props.Document[this.props.fieldKey], listSpec(Doc)); - if (!children) { - return; - } - let childrenList = ((children[Self] as any).__fields) as List<Doc>; - this._nodes = (childrenList) as List<Doc>; + reaction(() => this._time, time => { let infoContainer = this._infoContainer.current!; @@ -116,13 +126,6 @@ export class Timeline extends CollectionSubView(Document) { this.flyoutInfo.display = "none"; } - componentDidUpdate() { - runInAction(() => this._time = 100001); - } - - componentWillUnmount() { - document.removeEventListener("pointerdown", this.closeFlyout); - } //for playing @action |
