diff options
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/Main.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 1 | ||||
| -rw-r--r-- | src/client/views/nodes/Timeline.tsx | 39 |
3 files changed, 40 insertions, 2 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 175ef3c6d..ca77ff245 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -345,7 +345,7 @@ export class Main extends React.Component { let cat = Gateway.Instance.ClearCatalog(); cat.then(async () => { this.AddToNorthstarCatalog(await Gateway.Instance.GetCatalog()); - if (!CurrentUserUtils.GetNorthstarSchema("Book1")){ + if (!CurrentUserUtils.GetNorthstarSchema("Book1")) { this.AddToNorthstarCatalog(await Gateway.Instance.GetSchema("http://www.cs.brown.edu/~bcz/Book1.csv")); } }); diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 81ceb37f6..c73ee4f21 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -108,6 +108,7 @@ export class PDFBox extends React.Component<FieldViewProps> { componentWillUnmount() { if (this._reactionDisposer) { this._reactionDisposer(); + this._reactionDisposer = undefined; } } diff --git a/src/client/views/nodes/Timeline.tsx b/src/client/views/nodes/Timeline.tsx index 42e434413..1b6629a55 100644 --- a/src/client/views/nodes/Timeline.tsx +++ b/src/client/views/nodes/Timeline.tsx @@ -1,15 +1,19 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import { observer } from "mobx-react"; -import { observable, reaction, action } from "mobx"; +import { observable, reaction, action, IReactionDisposer } from "mobx"; import "./Timeline.scss"; import { KeyStore } from "../../../fields/KeyStore"; import { Document } from "../../../fields/Document"; import { KeyFrame } from "./KeyFrame"; +<<<<<<< HEAD import { CollectionViewProps } from "../collections/CollectionBaseView"; import { CollectionSubView } from "../collections/CollectionSubView"; import { DocumentViewProps } from "./DocumentView"; +======= +import { Opt } from '../../../fields/Field'; +>>>>>>> 6304e03f953b2cc66dcc1a0900855376ff739015 @observer export class Timeline extends React.Component<DocumentViewProps> { @@ -17,6 +21,7 @@ export class Timeline extends React.Component<DocumentViewProps> { @observable private _isRecording: Boolean = false; @observable private _currentBar: any = null; @observable private _newBar: any = null; + private _reactionDisposer: Opt<IReactionDisposer>; @action onRecord = (e: React.MouseEvent) => { @@ -26,8 +31,18 @@ export class Timeline extends React.Component<DocumentViewProps> { @action onStop = (e: React.MouseEvent) => { this._isRecording = false; +<<<<<<< HEAD if (this._inner.current) { +======= + if (this._inner.current) { //if you comment this section out it works as before... + this._newBar = document.createElement("div"); + this._newBar.style.height = "100%"; + this._newBar.style.width = "5px"; + this._newBar.style.backgroundColor = "yellow"; + this._newBar.style.transform = this._currentBar.style.transform; + this._inner.current.appendChild(this._newBar); +>>>>>>> 6304e03f953b2cc66dcc1a0900855376ff739015 } } @@ -41,6 +56,9 @@ export class Timeline extends React.Component<DocumentViewProps> { } } + createMark = (width: number) => { + + } private _keyFrames: KeyFrame[] = []; @@ -56,22 +74,41 @@ export class Timeline extends React.Component<DocumentViewProps> { } } + componentDidMount() { this.createBar(5); +<<<<<<< HEAD let doc: Document = this.props.Document; console.log(doc.Get(KeyStore.BackgroundColor)); let keyFrame = new KeyFrame(); this._keyFrames.push(keyFrame); let keys = [KeyStore.X, KeyStore.Y]; reaction(() => { +======= + let doc: Document; + let keyFrame = new KeyFrame(); + this._keyFrames.push(keyFrame); + let keys = [KeyStore.X, KeyStore.Y]; + this._reactionDisposer = reaction(() => { +>>>>>>> 6304e03f953b2cc66dcc1a0900855376ff739015 return keys.map(key => doc.GetNumber(key, 0)); }, data => { keys.forEach((key, index) => { keyFrame.document().SetNumber(key, data[index]); }); }); +<<<<<<< HEAD console.log(keyFrame.document + "Document"); +======= + } + + componentWillUnmount() { + if (this._reactionDisposer) { + this._reactionDisposer(); + this._reactionDisposer = undefined; + } +>>>>>>> 6304e03f953b2cc66dcc1a0900855376ff739015 } render() { |
