From fe562f1b6d61b02f5bdb073199af69cca56ef6cb Mon Sep 17 00:00:00 2001 From: Eleanor Eng Date: Tue, 16 Apr 2019 17:21:52 -0400 Subject: yellow line --- src/client/views/nodes/Timeline.tsx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/Timeline.tsx b/src/client/views/nodes/Timeline.tsx index 7881bf7fd..a5d8e9657 100644 --- a/src/client/views/nodes/Timeline.tsx +++ b/src/client/views/nodes/Timeline.tsx @@ -12,16 +12,28 @@ export class Timeline extends React.Component { @observable private _inner = React.createRef(); @observable private _isRecording: Boolean = false; @observable private _currentBar: any = null; + @observable private _newBar: any = null; @action onRecord = (e: React.MouseEvent) => { this._isRecording = true; - console.log("hello"); + // console.log("hello"); } @action onStop = (e: React.MouseEvent) => { this._isRecording = false; + if (this._inner.current) { + this._newBar = document.createElement("div"); + this._newBar.style.height = "100%"; + this._newBar.style.width = "5px"; + this._newBar.style.left = this._currentBar.style.left; + this._newBar.style.backgroundColor = "yellow"; + this._newBar.style.transform = this._currentBar.style.transform; + this._inner.current.appendChild(this._newBar); + } + this._currentBar.remove(); + this._currentBar = null; } @action @@ -41,9 +53,8 @@ export class Timeline extends React.Component { } else { this._currentBar.remove(); this._currentBar = null; - this.onInnerPointerDown(e); + this.onInnerPointerDown(e); } - } } } @@ -73,8 +84,8 @@ export class Timeline extends React.Component {
- - + + -- cgit v1.2.3-70-g09d2