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 59306705..49f044d7 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -47,11 +47,11 @@ 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 this.log('cacheArrays ' + this._boolCacheArrays) 50 //this.log('cacheArrays ' + this._boolCacheArrays)
51 if (this._boolCacheArrays) { 51 if (this._boolCacheArrays) {
52 this.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 }
56 } 56 }
57 }, 57 },
@@ -530,6 +530,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
530 while (layerResult = this.returnedObject[hashIndex]) { 530 while (layerResult = this.returnedObject[hashIndex]) {
531 trackResult = this.returnedTrack[hashIndex]; 531 trackResult = this.returnedTrack[hashIndex];
532 if (layerResult.deleted !== true) { 532 if (layerResult.deleted !== true) {
533
534 // TODO: Help from Kruti
533 this.arrTracks.push(trackResult); 535 this.arrTracks.push(trackResult);
534 this.arrLayers.push(layerResult); 536 this.arrLayers.push(layerResult);
535 537
@@ -545,6 +547,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
545 while (dLayer[hashVariable]) { 547 while (dLayer[hashVariable]) {
546 if (dLayer[hashVariable]._layerID === event.detail._el._layerID) { 548 if (dLayer[hashVariable]._layerID === event.detail._el._layerID) {
547 dLayer[hashVariable].deleted = false; 549 dLayer[hashVariable].deleted = false;
550
551 // TODO: Help from Kruti
548 this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); 552 this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track);
549 this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); 553 this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el);
550 this.selectLayer(event.detail._layerPosition); 554 this.selectLayer(event.detail._layerPosition);
@@ -572,6 +576,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
572 while (dLayer[hashVariable]) { 576 while (dLayer[hashVariable]) {
573 if (dLayer[hashVariable]._layerID === event.detail._el._layerID) { 577 if (dLayer[hashVariable]._layerID === event.detail._el._layerID) {
574 dLayer[hashVariable].deleted = false; 578 dLayer[hashVariable].deleted = false;
579
580 // TODO: Help from Kruti
575 this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track); 581 this.arrTracks.splice(event.detail._layerPosition, 0, event.detail._track);
576 this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el); 582 this.arrLayers.splice(event.detail._layerPosition, 0, event.detail._el);
577 this.selectLayer(event.detail._layerPosition); 583 this.selectLayer(event.detail._layerPosition);
@@ -608,6 +614,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
608 thingToPush.deleted = false; 614 thingToPush.deleted = false;
609 thingToPush.isSelected = false; 615 thingToPush.isSelected = false;
610 thingToPush.created=false; 616 thingToPush.created=false;
617 thingToPush.isTrackAnimated = false;
618 thingToPush.currentKeyframeRule = null;
619 thingToPush.trackPosition = 0;
620 thingToPush.arrStyleTracks = [];
621 thingToPush.tweens = [];
611 if (_firstLayerDraw) { 622 if (_firstLayerDraw) {
612 623
613 this.application.ninja.currentSelectedContainer.uuid=this._hashKey; 624 this.application.ninja.currentSelectedContainer.uuid=this._hashKey;
@@ -619,7 +630,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
619 event.detail.ele.uuid =nj.generateRandom(); 630 event.detail.ele.uuid =nj.generateRandom();
620 thingToPush.elementsList.push(event.detail.ele); 631 thingToPush.elementsList.push(event.detail.ele);
621 } 632 }
622 633 /*
623 newTrack.trackID = this.currentLayerNumber; 634 newTrack.trackID = this.currentLayerNumber;
624 newTrack.isMainCollapsed = true; 635 newTrack.isMainCollapsed = true;
625 newTrack.isPositionCollapsed = true; 636 newTrack.isPositionCollapsed = true;
@@ -630,6 +641,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
630 newTrack.trackPosition = 0; 641 newTrack.trackPosition = 0;
631 newTrack.arrStyleTracks = []; 642 newTrack.arrStyleTracks = [];
632 newTrack.tweens = []; 643 newTrack.tweens = [];
644 */
633 645
634 if (_firstLayerDraw) { 646 if (_firstLayerDraw) {
635 if (this.application.ninja.currentSelectedContainer.id === "UserContent") { 647 if (this.application.ninja.currentSelectedContainer.id === "UserContent") {
@@ -643,18 +655,23 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
643 myIndex = this.layerRepetition.selectedIndexes[0]; 655 myIndex = this.layerRepetition.selectedIndexes[0];
644 thingToPush.layerPosition = myIndex; 656 thingToPush.layerPosition = myIndex;
645 thingToPush.isSelected = true; 657 thingToPush.isSelected = true;
646 newTrack.trackPosition = myIndex; 658 //newTrack.trackPosition = myIndex;
647 this.arrTracks.splice(myIndex, 0, newTrack); 659 thingToPush.trackPosition = myIndex;
660 //this.arrTracks.splice(myIndex, 0, newTrack);
648 this.arrLayers.splice(myIndex, 0, thingToPush); 661 this.arrLayers.splice(myIndex, 0, thingToPush);
649 this._LayerUndoPosition = myIndex; 662 this._LayerUndoPosition = myIndex;
650 this.selectLayer(myIndex); 663 this.selectLayer(myIndex);
651 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 664 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
652 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); 665 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex);
666
667 // TODO: Help from Kruti
653 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); 668 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex);
654 } else { 669 } else {
655 this.arrTracks.splice(0, 0, newTrack); 670 //this.arrTracks.splice(0, 0, newTrack);
656 this.arrLayers.splice(0, 0, thingToPush); 671 this.arrLayers.splice(0, 0, thingToPush);
657 thingToPush.layerPosition = this.arrLayers.length - 1; 672 thingToPush.layerPosition = this.arrLayers.length - 1;
673
674 // TODO: Help from Kruti
658 newTrack.trackPosition = this.arrTracks.length - 1; 675 newTrack.trackPosition = this.arrTracks.length - 1;
659 this._LayerUndoPosition = this.arrLayers.length - 1; 676 this._LayerUndoPosition = this.arrLayers.length - 1;
660 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 677 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
@@ -697,7 +714,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
697 dLayer[hashVariable].deleted = true; 714 dLayer[hashVariable].deleted = true;
698// ElementMediator.deleteElements(dLayer[myIndex].element); 715// ElementMediator.deleteElements(dLayer[myIndex].element);
699 this.arrLayers.splice(k, 1); 716 this.arrLayers.splice(k, 1);
700 this.arrTracks.splice(k, 1); 717 //this.arrTracks.splice(k, 1);
701 if(k>0){ 718 if(k>0){
702 this.selectLayer(k-1); 719 this.selectLayer(k-1);
703 }else{ 720 }else{
@@ -735,7 +752,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
735 dLayer[hashVariable].deleted = true; 752 dLayer[hashVariable].deleted = true;
736// ElementMediator.deleteElements(dLayer[myIndex].element); 753// ElementMediator.deleteElements(dLayer[myIndex].element);
737 this.arrLayers.splice(k, 1); 754 this.arrLayers.splice(k, 1);
738 this.arrTracks.splice(k, 1); 755 //this.arrTracks.splice(k, 1);
739 if(k>0){ 756 if(k>0){
740 this.selectLayer(k-1); 757 this.selectLayer(k-1);
741 }else{ 758 }else{
@@ -754,6 +771,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
754 if (!!this.layerRepetition.selectedIndexes) { 771 if (!!this.layerRepetition.selectedIndexes) {
755 var myIndex = this.layerRepetition.selectedIndexes[0]; 772 var myIndex = this.layerRepetition.selectedIndexes[0];
756 this._LayerUndoObject = this.arrLayers[myIndex]; 773 this._LayerUndoObject = this.arrLayers[myIndex];
774
775 // TODO: Help from Kruti
757 this._TrackUndoObject = this.arrTracks[myIndex]; 776 this._TrackUndoObject = this.arrTracks[myIndex];
758 777
759 dLayer = this.hashInstance.getItem(this._hashKey); 778 dLayer = this.hashInstance.getItem(this._hashKey);
@@ -761,7 +780,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
761 dLayer[myIndex].deleted = true; 780 dLayer[myIndex].deleted = true;
762 781
763 this.arrLayers.splice(myIndex, 1); 782 this.arrLayers.splice(myIndex, 1);
764 this.arrTracks.splice(myIndex, 1); 783 //this.arrTracks.splice(myIndex, 1);
765 this._LayerUndoIndex = this._LayerUndoObject.layerID; 784 this._LayerUndoIndex = this._LayerUndoObject.layerID;
766 this._LayerUndoPosition = myIndex; 785 this._LayerUndoPosition = myIndex;
767 786
@@ -781,6 +800,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
781 this._LayerUndoPosition = this.arrLayers.length - 1; 800 this._LayerUndoPosition = this.arrLayers.length - 1;
782 this._LayerUndoObject = this.arrLayers.pop(); 801 this._LayerUndoObject = this.arrLayers.pop();
783 this._LayerUndoIndex = this._LayerUndoObject.layerID; 802 this._LayerUndoIndex = this._LayerUndoObject.layerID;
803
804 // TODO: Help from Kruti
784 this._TrackUndoObject = this.arrTracks.pop(); 805 this._TrackUndoObject = this.arrTracks.pop();
785 } 806 }
786 } 807 }
@@ -1025,7 +1046,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1025 this.layerRepetition.selectedIndexes = [layerIndex]; 1046 this.layerRepetition.selectedIndexes = [layerIndex];
1026 this.trackRepetition.selectedIndexes = [layerIndex]; 1047 this.trackRepetition.selectedIndexes = [layerIndex];
1027 this.currentLayerSelected = this.arrLayers[layerIndex]; 1048 this.currentLayerSelected = this.arrLayers[layerIndex];
1028 this.currentTrackSelected = this.arrTracks[layerIndex]; 1049 //this.currentTrackSelected = this.arrTracks[layerIndex];
1029 if(!this._openDoc){ 1050 if(!this._openDoc){