aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js21
-rw-r--r--js/panels/Timeline/Span.reel/Span.js3
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js23
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js7
4 files changed, 45 insertions, 9 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 4941ff79..0abd97be 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -710,7 +710,15 @@ var Layer = exports.Layer = Montage.create(Component, {
710 // Set up the event info and dispatch the event 710 // Set up the event info and dispatch the event
711 this.styleCounter += 1; 711 this.styleCounter += 1;
712 // newEvent.styleSelection = mySelection; 712 // newEvent.styleSelection = mySelection;
713 defaultEventManager.dispatchEvent(newEvent); 713 //defaultEventManager.dispatchEvent(newEvent);
714
715 // Dispatch the event to the TimelineTrack component associated with this Layer.
716 var myIndex = this.application.ninja.timeline.getActiveLayerIndex(),
717 arrTracks = document.querySelectorAll('[data-montage-id="track"]');
718
719 if (myIndex !== false) {
720 arrTracks[myIndex].dispatchEvent(newEvent);
721 }
714 } 722 }
715 }, 723 },
716 724
@@ -728,8 +736,15 @@ var Layer = exports.Layer = Montage.create(Component, {
728 newEvent.layerID = this.layerID; 736 newEvent.layerID = this.layerID;
729 newEvent.styleID = this.selectedStyleIndex; 737 newEvent.styleID = this.selectedStyleIndex;
730 newEvent.selectedStyleIndex = this.selectedStyleIndex; 738 newEvent.selectedStyleIndex = this.selectedStyleIndex;
731 defaultEventManager.dispatchEvent(newEvent); 739
732 740 // Dispatch the event to the TimelineTrack component associated with this Layer.
741 var myIndex = this.application.ninja.timeline.getActiveLayerIndex(),
742 arrTracks = document.querySelectorAll('[data-montage-id="track"]');
743
744 if (myIndex !== false) {
745 arrTracks[myIndex].dispatchEvent(newEvent);
746 }
747
733 // Delete the style from the view 748 // Delete the style from the view
734 this.arrLayerStyles.splice(this.selectedStyleIndex, 1); 749 this.arrLayerStyles.splice(this.selectedStyleIndex, 1);
735 750
diff --git a/js/panels/Timeline/Span.reel/Span.js b/js/panels/Timeline/Span.reel/Span.js
index 5b0f3f94..59cd13ed 100644
--- a/js/panels/Timeline/Span.reel/Span.js
+++ b/js/panels/Timeline/Span.reel/Span.js
@@ -67,6 +67,9 @@ var Span = exports.Span = Montage.create(Component, {
67 }, 67 },
68 set: function(newVal) { 68 set: function(newVal) {
69 if (newVal !== this._easing) { 69 if (newVal !== this._easing) {
70 if (typeof(newVal) === "undefined") {
71 newVal = "ease-in";
72 }
70 this._easing = newVal; 73 this._easing = newVal;
71 this.parentComponent.setKeyframeEase(newVal); 74 this.parentComponent.setKeyframeEase(newVal);
72 this.needsDraw = true; 75 this.needsDraw = true;
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index bb3ff170..27b3537c 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -933,12 +933,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
933 933
934 // We're reading from the cache, not writing to it. 934 // We're reading from the cache, not writing to it.
935 this._boolCacheArrays = false; 935 this._boolCacheArrays = false;
936
937 // We are about to redraw the layers and tracks for the first time, so they need to go through their
938 // respective firstDraw routines.
936 for (i = 0; i < tlArrLayersLength; i++) { 939 for (i = 0; i < tlArrLayersLength; i++) {
937 if (this.application.ninja.currentDocument.tlArrLayers[i].layerData.isSelected === true) { 940 this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = true;
938 this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = true;
939 } else {
940 this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = false;
941 }
942 } 941 }
943 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers; 942 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers;
944 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 943 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
@@ -1935,6 +1934,20 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1935 return false; 1934 return false;
1936 } 1935 }
1937 }, 1936 },
1937
1938 getActiveLayerIndex: {
1939 value: function() {
1940 var i = 0,
1941 returnVal = false,
1942 arrLayersLength = this.arrLayers.length;
1943 for (i = 0; i < arrLayersLength; i++) {
1944 if (this.arrLayers[i].isSelected === true) {
1945 returnVal = i;
1946 }
1947 }
1948 return returnVal;
1949 }
1950 },
1938 /* === END: Controllers === */ 1951 /* === END: Controllers === */
1939 1952
1940 /* === BEGIN: Logging routines === */ 1953 /* === BEGIN: Logging routines === */
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 9276a7df..3db57a3a 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -41,6 +41,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
41 this._tween = newVal; 41 this._tween = newVal;
42 } 42 }
43 }, 43 },
44
45 _isFirstDraw: {
46 value: true
47 },
44 48
45 _isVisible:{ 49 _isVisible:{
46 value: true 50 value: true
@@ -970,7 +974,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
970 value:function () { 974 value:function () {
971 this.createPositionTracks(); 975 this.createPositionTracks();
972 // Register event handler for layer events. 976 // Register event handler for layer events.
973 defaultEventManager.addEventListener("layerEvent", this, false); 977 //defaultEventManager.addEventListener("layerEvent", this, false);
978 this.element.addEventListener("layerEvent", this, false);
974 } 979 }
975 }, 980 },
976 981