aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js1
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html5
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js61
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js1
4 files changed, 55 insertions, 13 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index e75b4d0f..d50360e6 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -509,7 +509,6 @@ var Layer = exports.Layer = Montage.create(Component, {
509 this.styleCollapser.bypassAnimation = true; 509 this.styleCollapser.bypassAnimation = true;
510 this.styleCollapser.toggle(); 510 this.styleCollapser.toggle();
511 } 511 }
512
513 if (this.isSelected) { 512 if (this.isSelected) {
514 this.element.classList.add("selected"); 513 this.element.classList.add("selected");
515 } else { 514 } else {
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
index 92adee05..1aa9a725 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
@@ -32,7 +32,8 @@
32 "timetext" : {"#": "time_text"}, 32 "timetext" : {"#": "time_text"},
33 "timebar" : {"#": "time_bar"}, 33 "timebar" : {"#": "time_bar"},
34 "container_tracks" : {"#" : "container-tracks"}, 34 "container_tracks" : {"#" : "container-tracks"},
35 "end_hottext" : {"@" : "endHottext"} 35 "end_hottext" : {"@" : "endHottext"},
36 "getme" : {"#" : "getme"}
36 } 37 }
37 }, 38 },
38 39
@@ -284,7 +285,7 @@
284 285
285 <div id="user_layers" class="userlayers"> 286 <div id="user_layers" class="userlayers">
286 <div id="master_layer" class="masterlayer"> 287 <div id="master_layer" class="masterlayer">
287 <div>Master Layer</div> 288 <div id="getme">Master Layer</div>
288 </div> 289 </div>
289 <div id="container-layers"> 290 <div id="container-layers">
290 <div id="container-layer"></div> 291 <div id="container-layer"></div>
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d7d5328e..0feada6b 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -171,7 +171,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
171 /* === BEGIN: Draw cycle === */ 171 /* === BEGIN: Draw cycle === */
172 prepareForDraw:{ 172 prepareForDraw:{
173 value:function () { 173 value:function () {
174 this.initTimeline();
174 this.eventManager.addEventListener( "onOpenDocument", this, false); 175 this.eventManager.addEventListener( "onOpenDocument", this, false);
176 this.eventManager.addEventListener("closeDocument", this, false);
175 } 177 }
176 }, 178 },
177 179
@@ -194,6 +196,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
194 196
195 } 197 }
196 }, 198 },
199
200 handleCloseDocument: {
201 value: function(event) {
202 this.clearTimelinePanel();
203 }
204 },
197 willDraw:{ 205 willDraw:{
198 value:function () { 206 value:function () {
199 if (this._isLayer) { 207 if (this._isLayer) {
@@ -205,10 +213,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
205 /* === END: Draw cycle === */ 213 /* === END: Draw cycle === */
206 214
207 /* === BEGIN: Controllers === */ 215 /* === BEGIN: Controllers === */
208 initTimelineView:{ 216 initTimeline : {
209 value:function () { 217 value: function() {
210 var myIndex; 218 // Set up basic Timeline functions: event listeners, etc. Things that only need to be run once.
211 this.layout_tracks = this.element.querySelector(".layout-tracks"); 219 this.layout_tracks = this.element.querySelector(".layout-tracks");
212 this.layout_markers = this.element.querySelector(".layout_markers"); 220 this.layout_markers = this.element.querySelector(".layout_markers");
213 221
214 this.newlayer_button.identifier = "addLayer"; 222 this.newlayer_button.identifier = "addLayer";
@@ -219,6 +227,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
219 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 227 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
220 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 228 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
221 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); 229 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false);
230
231 }
232 },
233 initTimelineView:{
234 value:function () {
235 var myIndex;
236
222 237
223 this.drawTimeMarkers(); 238 this.drawTimeMarkers();
224 239
@@ -249,18 +264,42 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
249 264
250 clearTimelinePanel : { 265 clearTimelinePanel : {
251 value: function() { 266 value: function() {
252 console.log('clearing timeline...') 267 // Remove events
253 this.arrTracks = null; 268 this.eventManager.removeEventListener("deleteLayerClick", this, false);
254 this.arrLayers = null; 269 this.eventManager.removeEventListener("newLayer", this, false);
270 this.eventManager.removeEventListener("deleteLayer", this, false);
271 this.eventManager.removeEventListener("layerBinding", this, false);
272 this.eventManager.removeEventListener("elementAdded", this, false);
273 this.eventManager.removeEventListener("elementDeleted", this, false);
274 this.eventManager.removeEventListener("deleteSelection", this, false);
275 this.eventManager.removeEventListener("selectionChange", this, true);
276
277 // Reset visual appearance
278 this.application.ninja.timeline.playhead.style.left = "-2px";
279 this.application.ninja.timeline.playheadmarker.style.left = "0px";
280 this.application.ninja.timeline.updateTimeText(0.00);
281 this.timebar.style.width = "0px";
282
283 // Clear variables--including repetitions.
284 this.hashInstance = null;
285 this.hashTrackInstance = null;
286 this.hashLayerNumber = null;
287 this.hashElementMapToLayer = null;
288 this.arrTracks = [];
289 this.arrLayers = [];
255 this.currentLayerNumber = 0; 290 this.currentLayerNumber = 0;
256 this.currentLayerSelected = null; 291 this.currentLayerSelected = false;
257 this.currentTrackSelected = null; 292 this.currentTrackSelected = false;
258 this.selectedKeyframes = []; 293 this.selectedKeyframes = [];
259 this.selectedTweens = []; 294 this.selectedTweens = [];
260 this._captureSelection = false; 295 this._captureSelection = false;
261 this._openDoc = false; 296 this._openDoc = false;
262 this.end_hottext.value = 25; 297 this.end_hottext.value = 25;
263 this.updateTrackContainerWidth(); 298 this.updateTrackContainerWidth();
299
300 // Redraw all the things
301 this.layerRepetition.needsDraw = true;
302 this.trackRepetition.needsDraw = true;
264 this.needsDraw = true; 303 this.needsDraw = true;
265 } 304 }
266 }, 305 },
@@ -492,6 +531,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
492 531
493 if(this._openDoc){ 532 if(this._openDoc){
494 event.detail.ele.uuid =nj.generateRandom(); 533 event.detail.ele.uuid =nj.generateRandom();
534 console.log("in open doc")
535 console.log(event.detail.ele)
495 thingToPush.elementsList.push(event.detail.ele); 536 thingToPush.elementsList.push(event.detail.ele);
496 } 537 }
497 538
@@ -647,7 +688,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
647 688
648 handleElementAdded:{ 689 handleElementAdded:{
649 value:function (event) { 690 value:function (event) {
650 691 console.log('called')
651 event.detail.uuid=nj.generateRandom(); 692 event.detail.uuid=nj.generateRandom();
652 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); 693 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
653 this.currentLayerSelected.elementsList.push(event.detail); 694 this.currentLayerSelected.elementsList.push(event.detail);
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index f6dbf32c..70b52297 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -140,6 +140,7 @@ var Tween = exports.Tween = Montage.create(Component, {
140 value:function (event) { 140 value:function (event) {
141 if (event.detail.source && event.detail.source !== "tween") { 141 if (event.detail.source && event.detail.source !== "tween") {
142 // check for correct element selection 142 // check for correct element selection
143 console.log(this.application.ninja.selectedElements[0]._element)
143 if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) { 144 if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) {
144 alert("Wrong element selected for this keyframe track"); 145 alert("Wrong element selected for this keyframe track");
145 } else { 146 } else {