aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js26
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js1
2 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 6a9e0140..67ff3c02 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -617,7 +617,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
617 this.arrTracks.splice(myIndex, 0, newTrack); 617 this.arrTracks.splice(myIndex, 0, newTrack);
618 this.arrLayers.splice(myIndex, 0, thingToPush); 618 this.arrLayers.splice(myIndex, 0, thingToPush);
619 this._LayerUndoPosition = myIndex; 619 this._LayerUndoPosition = myIndex;
620// this.selectLayer(myIndex); 620 this.selectLayer(myIndex);
621 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 621 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
622 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); 622 this.hashInstance.setItem(this._hashKey, thingToPush, myIndex);
623 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); 623 this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex);
@@ -630,7 +630,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
630 this.hashLayerNumber.setItem(this._hashKey, thingToPush); 630 this.hashLayerNumber.setItem(this._hashKey, thingToPush);
631 this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); 631 this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition);
632 this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); 632 this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition);
633// this.selectLayer(0); 633 this.selectLayer(0);
634 634
635 } 635 }
636 636
@@ -760,9 +760,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
760 760
761 handleElementAdded:{ 761 handleElementAdded:{
762 value:function (event) { 762 value:function (event) {
763
763 event.detail.uuid=nj.generateRandom(); 764 event.detail.uuid=nj.generateRandom();
764 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); 765 if(this.currentLayerSelected.elementsList[0]!==undefined){
765 this.currentLayerSelected.elementsList.push(event.detail); 766 if(this.currentTrackSelected.isTrackAnimated){
767 this.application.ninja.stage.clearDrawingCanvas();
768 alert("cannot add elements to a layer with animated element");/* check how to clear the canvas*/
769 return;
770 }else{
771 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
772 this.currentLayerSelected.elementsList.push(event.detail);
773 }
774 }else{
775 this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
776 this.currentLayerSelected.elementsList.push(event.detail);
777 }
766 778
767 } 779 }
768 }, 780 },
@@ -986,7 +998,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
986 this.currentTrackSelected = this.arrTracks[layerIndex]; 998 this.currentTrackSelected = this.arrTracks[layerIndex];
987 if(!this._openDoc){ 999 if(!this._openDoc){
988 if(this._captureSelection){ 1000 if(this._captureSelection){
989 this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) 1001 if(this.currentLayerSelected.elementsList.length >= 1){
1002 this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList);
1003 }else{
1004 this.application.ninja.selectionController.executeSelectElement();
1005 }
990 } 1006 }
991 this._captureSelection = true; 1007 this._captureSelection = true;
992 } 1008 }
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 43cd7477..bf97c0fd 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -519,6 +519,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
519 i++; 519 i++;
520 this.nextKeyframe += 1; 520 this.nextKeyframe += 1;
521 } 521 }
522 this.isTrackAnimated = true;
522 } 523 }
523 } 524 }
524 else{ 525 else{