diff options
| author | madelinegr <laura_wilson@brown.edu> | 2019-04-16 18:43:05 -0400 |
|---|---|---|
| committer | madelinegr <laura_wilson@brown.edu> | 2019-04-16 18:43:05 -0400 |
| commit | 2517f6fb0084fe3a9a06d4dcaa330fee4dad4d73 (patch) | |
| tree | e0f073b7067e1deec8f0be53ba9dc929767129ae | |
| parent | fe562f1b6d61b02f5bdb073199af69cca56ef6cb (diff) | |
little mod
| -rw-r--r-- | src/client/views/nodes/Timeline.tsx | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/client/views/nodes/Timeline.tsx b/src/client/views/nodes/Timeline.tsx index a5d8e9657..c6aa0b146 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 @@ -40,21 +39,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.left = "mouse.offsetX"; - 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)`; } } } @@ -62,7 +48,20 @@ export class Timeline extends React.Component { private _keyFrames: KeyFrame[] = []; + 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); |
