aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelinePanel.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js68
2 files changed, 67 insertions, 3 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
index 6e7d410c..2e0bf7dd 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
@@ -19,7 +19,7 @@
19 "element": {"#": "timeline_panel"}, 19 "element": {"#": "timeline_panel"},
20 "user_layers": {"#": "user_layers"}, 20 "user_layers": {"#": "user_layers"},
21 "track_container": {"#": "right_inside"}, 21 "track_container": {"#": "right_inside"},
22 "timeline_leftpane" : {"#" : "timeline_leftpane"}, 22 "timeline_leftpane" : {"#" : "leftpane_inside"},
23 "layer_tracks": {"#": "layer_tracks"}, 23 "layer_tracks": {"#": "layer_tracks"},
24 "master_track": {"#": "master_track"}, 24 "master_track": {"#": "master_track"},
25 "time_markers" : {"#": "timeline_markers"}, 25 "time_markers" : {"#": "timeline_markers"},
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index fd297fd3..0ba49c44 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -289,6 +289,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
289 createLayerTemplate:{ 289 createLayerTemplate:{
290 value:function () { 290 value:function () {
291 var returnObj = {}; 291 var returnObj = {};
292
292 returnObj.layerData = {}; 293 returnObj.layerData = {};
293 returnObj.layerData.layerName = null; 294 returnObj.layerData.layerName = null;
294 returnObj.layerData.layerID = null; 295 returnObj.layerData.layerID = null;
@@ -297,6 +298,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
297 returnObj.layerData.isTransformCollapsed = true; 298 returnObj.layerData.isTransformCollapsed = true;
298 returnObj.layerData.isStyleCollapsed = true; 299 returnObj.layerData.isStyleCollapsed = true;
299 returnObj.layerData.arrLayerStyles = []; 300 returnObj.layerData.arrLayerStyles = [];
301 returnObj.layerData.arrLayerStyles = [];
300 returnObj.layerData.elementsList = []; 302 returnObj.layerData.elementsList = [];
301 returnObj.layerData.deleted = false; 303 returnObj.layerData.deleted = false;
302 returnObj.layerData.isSelected = false; 304 returnObj.layerData.isSelected = false;
@@ -312,6 +314,51 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
312 return returnObj; 314 return returnObj;
313 } 315 }
314 }, 316 },
317
318 // Create an array of style objects for an element, for use
319 // in creating a new layer
320 createLayerStyles : {
321 value: function(ptrElement) {
322 // TODO: Create logic to loop through
323 // CSS properties on element and build
324 // array of layer styles for return.
325 // Right now this method just returns an array of one bogus style.
326
327 var returnArray = [],
328 newStyle = {},
329 styleID = "1@0"; // format: layerID + "@" + style counter
330
331 newStyle.styleID = styleID;
332 newStyle.whichView = "propval";
333 newStyle.editorProperty = "top";
334 newStyle.editorValue = 0;
335 newStyle.ruleTweener = false;
336 newStyle.isSelected = false;
337
338 returnArray.push(newStyle);
339
340 return returnArray;
341
342 }
343 },
344
345 // Create an array of style track objects for an element, for use
346 // in creating a new layer
347 createStyleTracks : {
348 value: function(ptrElement) {
349 // TODO: Create logic to loop through
350 // CSS properties on element and build
351 // array of layer styles for return.
352 // Right now this method just returns an array of one bogus style.
353
354 var returnArray = [];
355
356 returnArray.push("1");
357
358 return returnArray;
359
360 }
361 },
315 362
316 // Bind all document-specific events (pass in true to unbind) 363 // Bind all document-specific events (pass in true to unbind)
317 _bindDocumentEvents:{ 364 _bindDocumentEvents:{
@@ -342,7 +389,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
342 value:function () { 389 value:function () {
343 this.layout_tracks = this.element.querySelector(".layout-tracks"); 390 this.layout_tracks = this.element.querySelector(".layout-tracks");
344 this.layout_markers = this.element.querySelector(".layout_markers"); 391 this.layout_markers = this.element.querySelector(".layout_markers");
345 this.timeline_leftpane.addEventListener("click", this.timelineLeftPaneClick.bind(this), false); 392 this.timeline_leftpane.addEventListener("mousedown", this.timelineLeftPaneMousedown.bind(this), false);
346 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 393 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
347 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 394 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
348 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); 395 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false);
@@ -448,6 +495,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
448 // Clear the repetitions 495 // Clear the repetitions
449 if (this.arrLayers.length > 0) { 496 if (this.arrLayers.length > 0) {
450 this.arrLayers = []; 497 this.arrLayers = [];
498 this.arrLayers.length = 0;
451 } 499 }
452 } 500 }
453 }, 501 },
@@ -569,7 +617,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
569 } 617 }
570 }, 618 },
571 619
572 timelineLeftPaneClick:{ 620 timelineLeftPaneMousedown:{
573 value:function (event) { 621 value:function (event) {
574 var ptrParent = nj.queryParentSelector(event.target, ".container-layer"); 622 var ptrParent = nj.queryParentSelector(event.target, ".container-layer");
575 if (ptrParent !== false) { 623 if (ptrParent !== false) {
@@ -677,6 +725,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
677 thingToPush.layerData.layerID = this.currentLayerNumber; 725 thingToPush.layerData.layerID = this.currentLayerNumber;
678 thingToPush.parentElementUUID = this.hashKey; 726 thingToPush.parentElementUUID = this.hashKey;
679 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 727 thingToPush.parentElement = this.application.ninja.currentSelectedContainer;
728
729 // Are there styles to add?
730 thingToPush.layerData.arrLayerStyles = this.createLayerStyles();
731 thingToPush.layerData.arrStyleTracks = this.createStyleTracks();
680 732
681 if (this._openDoc) { 733 if (this._openDoc) {
682 ele.uuid = nj.generateRandom(); 734 ele.uuid = nj.generateRandom();
@@ -862,6 +914,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
862 } else { 914 } else {
863 this.arrLayers[i].layerData.isSelected = false; 915 this.arrLayers[i].layerData.isSelected = false;
864 } 916 }
917
918 this.triggerLayerBinding(i);
865 } 919 }
866 920
867 this.layerRepetition.selectedIndexes = [layerIndex]; 921 this.layerRepetition.selectedIndexes = [layerIndex];
@@ -1019,6 +1073,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1019 } 1073 }
1020 } 1074 }
1021 }, 1075 },
1076 // Trigger the layer/track data binding
1077 triggerLayerBinding : {
1078 value: function(intIndex) {
1079 if (this.arrLayers[intIndex].layerData.triggerBinding === true) {
1080 this.arrLayers[intIndex].layerData.triggerBinding = false;
1081 } else {
1082 this.arrLayers[intIndex].layerData.triggerBinding = true;
1083 }
1084 }
1085 },
1022 /* === END: Controllers === */ 1086 /* === END: Controllers === */
1023 1087
1024 /* === BEGIN: Logging routines === */ 1088 /* === BEGIN: Logging routines === */