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.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 01b03531..81415951 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -256,6 +256,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
256 while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) 256 while(this.application.ninja.currentDocument.documentRoot.children[myIndex])
257 { 257 {
258 this._openDoc=true; 258 this._openDoc=true;
259 this._captureSelection=true;
259 NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) 260 NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]})
260 myIndex++; 261 myIndex++;
261 } 262 }
@@ -579,7 +580,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
579 this.arrTracks.splice(myIndex, 0, newTrack); 580 this.arrTracks.splice(myIndex, 0, newTrack);
580 this.arrLayers.splice(myIndex, 0, thingToPush); 581 this.arrLayers.splice(myIndex, 0, thingToPush);
581 this._LayerUndoPosition = myIndex; 582 this._LayerUndoPosition = myIndex;
582// this.selectLayer(myIndex); 583 this.selectLayer(myIndex);
583 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 584 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
584 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); 585 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex);
585 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); 586 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex);
@@ -592,7 +593,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
592 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 593 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
593 this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); 594 this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition);
594 this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); 595 this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition);
595// this.selectLayer(0); 596 this.selectLayer(0);
596 597
597 } 598 }
598 599
@@ -722,9 +723,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
722 723
723 handleElementAdded:{ 724 handleElementAdded:{
724 value:function (event) { 725 value:function (event) {
726
725 event.detail.uuid=nj.generateRandom(); 727 event.detail.uuid=nj.generateRandom();
726 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); 728 if(this.currentLayerSelected.elementsList[0]!==undefined){
727 this.currentLayerSelected.elementsList.push(event.detail); 729 if(this.currentTrackSelected.isTrackAnimated){
730 this.application.ninja.stage.clearDrawingCanvas();
731 alert("cannot add elements to a layer with animated element");/* check how to clear the canvas*/
732 return;
733 }else{
734 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
735 this.currentLayerSelected.elementsList.push(event.detail);
736 }
737 }else{
738 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
739 this.currentLayerSelected.elementsList.push(event.detail);
740 }
728 741
729 } 742 }
730 }, 743 },
@@ -948,7 +961,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
948 this.currentTrackSelected = this.arrTracks[layerIndex]; 961 this.currentTrackSelected = this.arrTracks[layerIndex];
949 if(!this._openDoc){ 962 if(!this._openDoc){
950 if(this._captureSelection){ 963 if(this._captureSelection){
951 this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) 964 if(this.currentLayerSelected.elementsList.length >= 1){
965 this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList);
966 }else{
967 this.application.ninja.selectionController.executeSelectElement();
968 }
952 } 969 }
953 this._captureSelection = true; 970 this._captureSelection = true;
954 } 971 }