aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/Main.tsx3
-rw-r--r--src/client/views/nodes/Timeline.tsx32
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);