aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js43
1 files changed, 32 insertions, 11 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index a5cde00f..797a7cbf 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -230,8 +230,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
230 { 230 {
231 this._openDoc=true; 231 this._openDoc=true;
232 NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) 232 NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]})
233// this.selectLayer(myIndex);
234// TimelineTrack.retrieveStoredTweens();
235 myIndex++; 233 myIndex++;
236 } 234 }
237 }else{ 235 }else{
@@ -242,6 +240,24 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
242 _firstLayerDraw = true; 240 _firstLayerDraw = true;
243 } 241 }
244 }, 242 },
243
244 clearTimelinePanel : {
245 value: function() {
246 console.log('clearing timeline...')
247 this.arrTracks = null;
248 this.arrLayers = null;
249 this.currentLayerNumber = 0;
250 this.currentLayerSelected = null;
251 this.currentTrackSelected = null;
252 this.selectedKeyframes = [];
253 this.selectedTweens = [];
254 this._captureSelection = false;
255 this._openDoc = false;
256 this.end_hottext.value = 25;
257 this.updateTrackContainerWidth();
258 this.needsDraw = true;
259 }
260 },
245 261
246 updateTrackContainerWidth:{ 262 updateTrackContainerWidth:{
247 value: function(){ 263 value: function(){
@@ -318,6 +334,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
318 value:function (event) { 334 value:function (event) {
319 this._isLayer = true; 335 this._isLayer = true;
320 this.needsDraw = true; 336 this.needsDraw = true;
337 this.application.ninja.selectionController.executeSelectElement();
321 } 338 }
322 }, 339 },
323 340
@@ -469,7 +486,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
469 if(this._openDoc){ 486 if(this._openDoc){
470 event.detail.ele.uuid =nj.generateRandom(); 487 event.detail.ele.uuid =nj.generateRandom();
471 thingToPush.elementsList.push(event.detail.ele); 488 thingToPush.elementsList.push(event.detail.ele);
472 this._openDoc=false;
473 } 489 }
474 490
475 newTrack.trackID = this.currentLayerNumber; 491 newTrack.trackID = this.currentLayerNumber;
@@ -499,7 +515,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
499 this.arrTracks.splice(myIndex, 0, newTrack); 515 this.arrTracks.splice(myIndex, 0, newTrack);
500 this.arrLayers.splice(myIndex, 0, thingToPush); 516 this.arrLayers.splice(myIndex, 0, thingToPush);
501 this._LayerUndoPosition = myIndex; 517 this._LayerUndoPosition = myIndex;
502// this.selectLayer(myIndex); 518 this.selectLayer(myIndex);
503 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 519 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
504 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); 520 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex);
505 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); 521 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex);
@@ -512,16 +528,19 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
512 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 528 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
513 this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); 529 this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition);
514 this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); 530 this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition);
515// this.selectLayer(0); 531 this.selectLayer(0);
532
533 }
516 534
535 if(this._openDoc){
536 this.hashElementMapToLayer.setItem(event.detail.ele.uuid, event.detail.ele,this.currentLayerSelected);
537 this._openDoc=false;
517 } 538 }
518 this._LayerUndoObject = thingToPush; 539 this._LayerUndoObject = thingToPush;
519 this._LayerUndoIndex = thingToPush.layerID; 540 this._LayerUndoIndex = thingToPush.layerID;
520 this._LayerUndoStatus = true; 541 this._LayerUndoStatus = true;
521 this._TrackUndoObject = newTrack; 542 this._TrackUndoObject = newTrack;
522// if(_firstLayerDraw){ 543
523// this.application.ninja.selectionController.executeSelectElement();
524// }
525 544
526 } 545 }
527 } 546 }
@@ -716,6 +735,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
716 } 735 }
717 } 736 }
718 hashLayerObject[key][index] = value; 737 hashLayerObject[key][index] = value;
738 console.log(hashLayerObject)
719 this.counter = 0; 739 this.counter = 0;
720 } 740 }
721 }, 741 },
@@ -810,6 +830,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
810 } 830 }
811 this.mappingArray[key]["ele"] = value; 831 this.mappingArray[key]["ele"] = value;
812 this.mappingArray[key].layerID = layer.layerID; 832 this.mappingArray[key].layerID = layer.layerID;
833 console.log(this.mappingArray)
813 834
814 } 835 }
815 }, 836 },
@@ -846,9 +867,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
846 this.trackRepetition.selectedIndexes = [layerIndex]; 867 this.trackRepetition.selectedIndexes = [layerIndex];
847 this.currentLayerSelected = this.arrLayers[layerIndex]; 868 this.currentLayerSelected = this.arrLayers[layerIndex];
848 this.currentTrackSelected = this.arrTracks[layerIndex]; 869 this.currentTrackSelected = this.arrTracks[layerIndex];
849 /*if(this._captureSelection){ 870 if(this._captureSelection){
850 this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) 871 this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList)
851 }*/ 872 }
852 this._captureSelection = true; 873 this._captureSelection = true;
853 } else { 874 } else {
854 this.layerRepetition.selectedIndexes = null; 875 this.layerRepetition.selectedIndexes = null;