From 9cefcd17e5b1943685130553f6a4f62179df8936 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 26 Jun 2012 17:48:31 -0700 Subject: FIx - hook up play button in timeline to live preview Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 6 ++---- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index eac361a8..f6fae9b8 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html @@ -37,7 +37,8 @@ "checkable_animated" : {"#" : "checkable_animated"}, "tl_configbutton" : {"#" : "tl-configbutton"}, "checkable_lock" : {"#" : "checkable_lock"}, - "checkable_visible":{"#" : "checkable_visible"} + "checkable_visible":{"#" : "checkable_visible"}, + "play_button" : {"#" : "play_button"} } }, @@ -164,10 +165,7 @@
-
-
-
00:00:00
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index af358468..12b481de 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -910,6 +910,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.eventManager.addEventListener("updatedID", this.handleLayerIdUpdate.bind(this), false); this.checkable_lock.addEventListener("click",this.handleLockLayerClick.bind(this),false); this.checkable_visible.addEventListener("click",this.handleLayerVisibleClick.bind(this),false); + this.play_button.addEventListener("click", this.handlePlayButtonClick.bind(this), false); this.addPropertyChangeListener("currentDocument.model.domContainer", this); @@ -1085,6 +1086,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, + handlePlayButtonClick:{ + value:function(ev){ + this.application.ninja.appModel.livePreview = !this.application.ninja.appModel.livePreview; + + if (this.application.ninja.appModel.livePreview) { + this.play_button.classList.remove("playbutton"); + this.play_button.classList.add("pausebutton"); + + } else { + this.play_button.classList.remove("pausebutton"); + this.play_button.classList.add("playbutton"); + } + } + }, + handleKeyframeShortcut:{ value:function(action){ var tempEv = {}; -- cgit v1.2.3