aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js102
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js5
2 files changed, 79 insertions, 28 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 53a3b299..e613d4d7 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -117,28 +117,42 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
117 if (value === this._currentDocument) { 117 if (value === this._currentDocument) {
118 return; 118 return;
119 } 119 }
120
121 if(!this._currentDocument && value.currentView === "design") {
122 this.enablePanel(true);
123 }
124
125 this._currentDocument = value; 120 this._currentDocument = value;
121
122 var boolDoc = false,
123 boolView = false;
124
125 // Should we enable the panel?
126 // Only if we have both a document and we're in design view.
127 if (typeof(value) !== "undefined") {
128 if (value.currentView === "design") {
129 // We are in design view.
130 boolView = true;
131 }
132 }
133 if (typeof(this._currentDocument) !== "undefined") {
134 // We have a document, or at least we have initialized the panel.
135 boolDoc = true;
136 }
126 137
127 if(!value) { 138 if(boolDoc === false) {
128 this._boolCacheArrays = false; 139 this._boolCacheArrays = false;
129 this.clearTimelinePanel(); 140 this.clearTimelinePanel();
130 this._boolCacheArrays = true; 141 this._boolCacheArrays = true;
131 this.enablePanel(false); 142 this.enablePanel(false);
132 } else if(this._currentDocument.currentView === "design") { 143 } else {
133 this._boolCacheArrays = false; 144 if(boolView === true) {
134 this.clearTimelinePanel(); 145 this._boolCacheArrays = false;
135 this._boolCacheArrays = true; 146 this.clearTimelinePanel();
136 147 this._boolCacheArrays = true;
137 // Rebind the document events for the new document context 148
138 this._bindDocumentEvents(); 149 // Rebind the document events for the new document context
139 150 this._bindDocumentEvents();
140 // Initialize the timeline for the document. 151
141 this.initTimelineForDocument(); 152 // Initialize the timeline for the document.
153 this.initTimelineForDocument();
154 this.enablePanel(true);
155 }
142 } 156 }
143 } 157 }
144 }, 158 },
@@ -595,7 +609,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
595 prepareForDraw:{ 609 prepareForDraw:{
596 value:function () { 610 value:function () {
597 this.initTimeline(); 611 this.initTimeline();
598
599 } 612 }
600 }, 613 },
601 614
@@ -726,11 +739,27 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
726 if (this._boolCacheArrays) { 739 if (this._boolCacheArrays) {
727 // ... but only if we're supposed to. 740 // ... but only if we're supposed to.
728 if(this.currentDocument) { 741 if(this.currentDocument) {
742 var i = 0,
743 hashLength = this.application.ninja.currentDocument.tlBreadcrumbHash.length,
744 boolHash = false;
745
729 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 746 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
730 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer; 747 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer;
731 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 748 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
732 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; 749 this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected;
733 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; 750 this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected;
751 for (i = 0; i < hashLength; i++ ) {
752 if (this.application.ninja.currentDocument.tlBreadcrumbHash[i].containerUuid === this.currentDocument.model.domContainer.uuid) {
753 this.application.ninja.currentDocument.tlBreadcrumbHash[i].arrLayers = this.arrLayers;
754 boolHash = true;
755 }
756 }
757 if (boolHash === false) {
758 var newHash = {};
759 newHash.containerUuid = this.currentDocument.model.domContainer.uuid;
760 newHash.arrLayers = this.arrLayers;
761 this.application.ninja.currentDocument.tlBreadcrumbHash.push(newHash);
762 }
734 } 763 }
735 this.application.ninja.currentDocument.tlCurrentElementsSelected = this.currentElementsSelected; 764 this.application.ninja.currentDocument.tlCurrentElementsSelected = this.currentElementsSelected;
736 } 765 }
@@ -748,6 +777,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
748 this.application.ninja.currentDocument.tlCurrentLayersSelected = false; 777 this.application.ninja.currentDocument.tlCurrentLayersSelected = false;
749 this.application.ninja.currentDocument.tlCurrentElementsSelected = []; 778 this.application.ninja.currentDocument.tlCurrentElementsSelected = [];
750 this.application.ninja.currentDocument.lockedElements = []; 779 this.application.ninja.currentDocument.lockedElements = [];
780 this.application.ninja.currentDocument.tlBreadcrumbHash = [];
751 } 781 }
752 }, 782 },
753 783
@@ -891,7 +921,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
891 this.drawTimeMarkers(); 921 this.drawTimeMarkers();
892 // Document switching 922 // Document switching
893 // Check to see if we have saved timeline information in the currentDocument. 923 // Check to see if we have saved timeline information in the currentDocument.
894 //console.log("TimelinePanel.initTimelineForDocument"); 924 // console.log("TimelinePanel.initTimelineForDocument");
895 925
896 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) { 926 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) {
897 // console.log('TimelinePanel.initTimelineForDocument: new Document'); 927 // console.log('TimelinePanel.initTimelineForDocument: new Document');
@@ -924,20 +954,36 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
924 } else if (this.application.ninja.currentDocument.setLevel) { 954 } else if (this.application.ninja.currentDocument.setLevel) {
925 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); 955 // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
926 // Information stored, but we're moving up or down in the breadcrumb. 956 // Information stored, but we're moving up or down in the breadcrumb.
927 // Get the current selection and restore timeline info for its children. 957
928 var parentNode = this.currentDocument.model.domContainer, 958 var i = 0,
959 hash = this.application.ninja.currentDocument.tlBreadcrumbHash,
960 hashLength = hash.length,
961 boolHashed = false,
962 parentNode = this.currentDocument.model.domContainer,
929 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 963 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
930 this.temparrLayers = []; 964 this.temparrLayers = [];
931 965
932 for (myIndex = 0; parentNode.children[myIndex]; myIndex++) { 966 // It's possible there is something stored in the breadcrumb hash in currentdocument, so check there first.
933 this._openDoc = true; 967 for (i = 0; i < hashLength; i++ ) {
934 this.restoreLayer(parentNode.children[myIndex]); 968 if (hash[i].containerUuid === this.currentDocument.model.domContainer.uuid) {
935 969 this.temparrLayers = hash[i].arrLayers
936 } 970 boolHashed = true;
971 }
972 }
973
974 // Possibly nothing was in the hash, so check and if so fall back to old restoreLayer method.
975 if (boolHashed === false) {
976 for (myIndex = 0; parentNode.children[myIndex]; myIndex++) {
977 this._openDoc = true;
978 this.restoreLayer(parentNode.children[myIndex]);
979 }
980 }
981
937 // Draw the repetition. 982 // Draw the repetition.
938 this.arrLayers = this.temparrLayers; 983 this.arrLayers = this.temparrLayers;
939 this.currentLayerNumber = storedCurrentLayerNumber; 984 this.currentLayerNumber = storedCurrentLayerNumber;
940 this.application.ninja.currentDocument.setLevel = false; 985 this.application.ninja.currentDocument.setLevel = false;
986 this.resetMasterDuration();
941 987
942 } else { 988 } else {
943 // console.log('TimelinePanel.initTimelineForDocument: else fallback'); 989 // console.log('TimelinePanel.initTimelineForDocument: else fallback');
@@ -2038,7 +2084,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
2038 returnVal = false, 2084 returnVal = false,
2039 arrLayersLength = this.arrLayers.length; 2085 arrLayersLength = this.arrLayers.length;
2040 for (i = 0; i < arrLayersLength; i++) { 2086 for (i = 0; i < arrLayersLength; i++) {
2041 if (this.arrLayers[i].isSelected === true) { 2087 if (this.arrLayers[i].layerData.isSelected === true) {
2042 returnVal = i; 2088 returnVal = i;
2043 } 2089 }
2044 } 2090 }
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 68ea928a..dc1a5d99 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -1085,6 +1085,11 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
1085 createPositionTracks:{ 1085 createPositionTracks:{
1086 value:function(){ 1086 value:function(){
1087 // create track objects for position and transform tracks and push into arrays 1087 // create track objects for position and transform tracks and push into arrays
1088
1089 // ...