aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/Timeline.tsx
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2019-07-17 16:52:53 -0400
committerandrewdkim <adkim414@gmail.com>2019-07-17 16:52:53 -0400
commit5517ece90ee87d34acfa456435c162c32f2a6637 (patch)
tree2af6fef46108f0e59bb3c424dbd4b72346cab40d /src/client/views/nodes/Timeline.tsx
parent7ec4c97da1b6b410117ac675aff81d3a9a16593a (diff)
video integration and bug fixes
Diffstat (limited to 'src/client/views/nodes/Timeline.tsx')
-rw-r--r--src/client/views/nodes/Timeline.tsx26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/client/views/nodes/Timeline.tsx b/src/client/views/nodes/Timeline.tsx
index ee33245af..4e3f63c57 100644
--- a/src/client/views/nodes/Timeline.tsx
+++ b/src/client/views/nodes/Timeline.tsx
@@ -5,7 +5,7 @@ import { Document, listSpec, createSchema, makeInterface, defaultSpec } from "..
import { observer } from "mobx-react";
import { Track } from "./Track";
import { observable, reaction, action, IReactionDisposer, observe, IObservableArray, computed, toJS, Reaction, IObservableObject, trace, autorun, runInAction } from "mobx";
-import { Cast, NumCast } from "../../../new_fields/Types";
+import { Cast, NumCast, FieldValue } from "../../../new_fields/Types";
import { SelectionManager } from "../../util/SelectionManager";
import { List } from "../../../new_fields/List";
import { Self } from "../../../new_fields/FieldSymbols";
@@ -18,6 +18,8 @@ import { ContextMenu } from "../ContextMenu";
import { string } from "prop-types";
import { checkIfStateModificationsAreAllowed } from "mobx/lib/internal";
import { SelectorContextMenu } from "../collections/ParentDocumentSelector";
+import { DocumentManager } from "../../util/DocumentManager";
+import { CollectionVideoView } from "../collections/CollectionVideoView";
export interface FlyoutProps {
@@ -56,7 +58,6 @@ export class Timeline extends CollectionSubView(Document) {
@observable private _isPlaying: boolean = false;
@observable private _boxLength: number = 0;
@observable private _containerHeight: number = this.DEFAULT_CONTAINER_HEIGHT;
- @observable private _nodes: List<Doc> = new List<Doc>();
@observable private _time = 100000; //DEFAULT
@observable private _infoContainer = React.createRef<HTMLDivElement>();
@@ -65,6 +66,12 @@ 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;
+
+ @computed
+ private get children(){
+ return Cast(this.props.Document[this.props.fieldKey], listSpec(Doc)) as List<Doc>;
+ }
+
componentWillMount() {
console.log(this._ticks.length);
runInAction(() => {
@@ -76,15 +83,10 @@ 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;
- this._nodes = childrenList;
- });
this.initialize();
+
+ console.log(DocumentManager.Instance.getDocumentView(this.props.Document));
+ console.log(toJS(this.props.Document.data));
}
@@ -415,13 +417,13 @@ export class Timeline extends CollectionSubView(Document) {
<div className="scrubberhead"></div>
</div>
<div className="trackbox" ref={this._trackbox} onPointerDown={this.onPanDown}>
- {DocListCast(this._nodes).map(doc => {
+ {DocListCast(this.children).map(doc => {
return <Track node={doc} currentBarX={this._currentBarX} changeCurrentBarX={this.changeCurrentBarX} setFlyout={this.getFlyout} />;
})}
</div>
</div>
<div className="title-container" ref={this._titleContainer}>
- {DocListCast(this._nodes).map(doc => {
+ {DocListCast(this.children).map(doc => {
return <div className="datapane">
<p>{doc.title}</p>
</div>;