diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index b12183f2..0185d448 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -276,6 +276,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
276 | this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); | 276 | this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); |
277 | this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); | 277 | this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); |
278 | this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); | 278 | this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); |
279 | this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); | ||
280 | this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); | ||
281 | this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); | ||
279 | } | 282 | } |
280 | }, | 283 | }, |
281 | 284 | ||
@@ -410,6 +413,29 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
410 | } | 413 | } |
411 | }, | 414 | }, |
412 | 415 | ||
416 | startPlayheadTracking:{ | ||
417 | value:function(){ | ||
418 | this.time_markers.onmousemove = this.updatePlayhead.bind(this); | ||
419 | } | ||
420 | }, | ||
421 | |||
422 | stopPlayheadTracking:{ | ||
423 | value:function () { | ||
424 | this.time_markers.onmousemove = null; | ||
425 | } | ||
426 | }, | ||
427 | |||
428 | updatePlayhead:{ | ||
429 | value:function (event) { | ||
430 | var clickedPosition = event.target.offsetLeft + event.offsetX; | ||
431 | this.playhead.style.left = (clickedPosition - 2) + "px"; | ||
432 | this.playheadmarker.style.left = clickedPosition + "px"; | ||
433 | var currentMillisecPerPixel = Math.floor(this.millisecondsOffset / 80); | ||
434 | var currentMillisec = currentMillisecPerPixel * clickedPosition; | ||
435 | this.updateTimeText(currentMillisec); | ||
436 | } | ||
437 | }, | ||
438 | |||
413 | handleSelectionChange:{ | 439 | handleSelectionChange:{ |
414 | value:function(){ | 440 | value:function(){ |
415 | var key , switchSelectedLayer,layerIndex; | 441 | var key , switchSelectedLayer,layerIndex; |