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.js47
1 files changed, 39 insertions, 8 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index ec9555fe..59306705 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -47,9 +47,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
47 _cacheArrays : { 47 _cacheArrays : {
48 value: function() { 48 value: function() {
49 // Cache this.arrLayers and this.arrTracks. 49 // Cache this.arrLayers and this.arrTracks.
50 console.log('cacheArrays ' + this._boolCacheArrays) 50 this.log('cacheArrays ' + this._boolCacheArrays)
51 if (this._boolCacheArrays) { 51 if (this._boolCacheArrays) {
52 console.log('caching arrays for ', this.application.ninja.currentDocument.name); 52 this.log('caching arrays for ', this.application.ninja.currentDocument.name);
53 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; 53 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
54 this.application.ninja.currentDocument.tlArrTracks = this.arrTracks; 54 this.application.ninja.currentDocument.tlArrTracks = this.arrTracks;
55 } 55 }
@@ -264,7 +264,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
264 // Check to see if we have saved timeline information in the currentDocument. 264 // Check to see if we have saved timeline information in the currentDocument.
265 if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { 265 if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") {
266 // No, we have no information stored. Create it. 266 // No, we have no information stored. Create it.
267 console.log('newfile ' + this.application.ninja.currentDocument.name) 267 this.log('newfile ' + this.application.ninja.currentDocument.name)
268 this.application.ninja.currentDocument.isTimelineInitialized = true; 268 this.application.ninja.currentDocument.isTimelineInitialized = true;
269 this.application.ninja.currentDocument.tlArrLayers = []; 269 this.application.ninja.currentDocument.tlArrLayers = [];
270 this.application.ninja.currentDocument.tlArrTracks = []; 270 this.application.ninja.currentDocument.tlArrTracks = [];
@@ -281,7 +281,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
281 this._openDoc=true; 281 this._openDoc=true;
282 NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) 282 NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]})
283 myIndex++; 283 myIndex++;
284 k } 284 }
285 } 285 }
286 else{ 286 else{
287 NJevent('newLayer', this._hashKey); 287 NJevent('newLayer', this._hashKey);
@@ -300,7 +300,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
300 300
301 } else { 301 } else {
302 // we do have information stored. Use it. 302 // we do have information stored. Use it.
303 console.log('oldfile ' + this.application.ninja.currentDocument.name) 303 this.log('oldfile ' + this.application.ninja.currentDocument.name)
304 this._boolCacheArrays = false; 304 this._boolCacheArrays = false;
305 this.arrLayers = []; 305 this.arrLayers = [];
306 this.arrTracks = []; 306 this.arrTracks = [];
@@ -469,7 +469,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
469 469
470 handleDeleteLayerClick:{ 470 handleDeleteLayerClick:{
471 value:function (event) { 471 value:function (event) {
472 console.log('handleDeleteLayerClick called') 472 this.log('handleDeleteLayerClick called')
473 if (this.arrLayers.length === 1) { 473 if (this.arrLayers.length === 1) {
474 // do not delete last layer 474 // do not delete last layer
475 return; 475 return;
@@ -795,7 +795,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
795 if(this.currentLayerSelected.elementsList[0]!==undefined){ 795 if(this.currentLayerSelected.elementsList[0]!==undefined){
796 if(this.currentTrackSelected.isTrackAnimated){ 796 if(this.currentTrackSelected.isTrackAnimated){
797 this.application.ninja.stage.clearDrawingCanvas(); 797 this.application.ninja.stage.clearDrawingCanvas();
798 console.log("cannot add elements to a layer with animated element"); 798 this.log("cannot add elements to a layer with animated element");
799 return; 799 return;
800 }else{ 800 }else{
801 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); 801 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
@@ -1167,7 +1167,38 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1167 }); 1167 });
1168 return command; 1168 return command;
1169 } 1169 }
1170 } 1170 },
1171 /* === END: Controllers === */ 1171 /* === END: Controllers === */
1172
1173 /* === BEGIN: Logging routines === */
1174 _boolDebug: {
1175 enumerable: false,
1176 value: false // set to true to enable debugging to console; false for turning off all debugging.
1177 },
1178 boolDebug: {
1179 get: function() {
1180 return this._boolDebug;
1181 },
1182 set: function(boolDebugSwitch) {
1183 this._boolDebug = boolDebugSwitch;
1184 }
1185 },
1186 log: {
1187 value: function(strMessage) {
1188 if (this.boolDebug) {
1189 console.log(this.getLineNumber() + ": " + strMessage);
1190 }
1191 }
1192 },
1193 getLineNumber: {
1194 value: function() {
1195 try {
1196 throw new Error('bazinga')
1197 }catch(e){
1198 return e.stack.split("at")[3].split(":")[2];
1199 }
1200 }
1201 }
1202 /* === END: Logging routines === */
1172}); 1203});
1173 1204