diff options
| author | Eleanor Eng <eleanor_eng@brown.edu> | 2019-04-20 17:23:27 -0400 |
|---|---|---|
| committer | Eleanor Eng <eleanor_eng@brown.edu> | 2019-04-20 17:23:27 -0400 |
| commit | 5469990566c237014d3350ddb1709c253feb2a55 (patch) | |
| tree | 00d6673d346fc4711d98cdad157fc2fad671be4a | |
| parent | 8788dfa4dc04219940b50c42bb99221f75f63eab (diff) | |
| parent | 2517f6fb0084fe3a9a06d4dcaa330fee4dad4d73 (diff) | |
main fix
| -rw-r--r-- | src/client/views/Main.tsx | 3 | ||||
| -rw-r--r-- | src/client/views/nodes/Timeline.tsx | 32 |
2 files changed, 18 insertions, 17 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 35d5e8a35..0181e98e9 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -385,8 +385,9 @@ 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/Timeline.tsx b/src/client/views/nodes/Timeline.tsx index ffdd34b78..634a16573 100644 --- a/src/client/views/nodes/Timeline.tsx +++ b/src/client/views/nodes/Timeline.tsx @@ -17,7 +17,6 @@ export class Timeline extends React.Component { @action onRecord = (e: React.MouseEvent) => { this._isRecording = true; - // console.log("hello"); } @action @@ -39,20 +38,8 @@ export class Timeline extends React.Component { onInnerPointerDown = (e: React.PointerEvent) => { if (this._isRecording) { if (this._inner.current) { - if (this._currentBar === null) { - console.log("rr"); - let mouse = e.nativeEvent; - this._currentBar = document.createElement("div"); - this._currentBar.style.height = "100%"; - this._currentBar.style.width = "5px"; - this._currentBar.style.backgroundColor = "white"; - this._currentBar.style.transform = `translate(${mouse.offsetX}px)`; - this._inner.current.appendChild(this._currentBar); - } else { - this._currentBar.remove(); - this._currentBar = null; - this.onInnerPointerDown(e); - } + let mouse = e.nativeEvent; + this._currentBar.style.transform = `translate(${mouse.offsetX}px)`; } } } @@ -63,8 +50,21 @@ export class Timeline extends React.Component { private _keyFrames: KeyFrame[] = []; - componentDidMount() { + createBar = (width: number) => { + if (this._inner.current) { + this._currentBar = document.createElement("div"); + this._currentBar.style.height = "100%"; + this._currentBar.style.width = `${width}px`; + this._currentBar.style.left = "mouse.offsetX"; + this._currentBar.style.backgroundColor = "green"; + this._currentBar.style.transform = `translate(${0}px)`; + this._inner.current.appendChild(this._currentBar); + } + } + + componentDidMount() { + this.createBar(5); // let doc: Document; // let keyFrame = new KeyFrame(); // this._keyFrames.push(keyFrame); |
