aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js6
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js26
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js1
3 files changed, 27 insertions, 6 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 02031922..64ff2c7e 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -195,7 +195,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
195 value:function(doc){ 195 value:function(doc){
196 var response = doc || null;//default just for testing 196 var response = doc || null;//default just for testing
197 if(!!response && response.success && (response.status!== 500) && !!response.uri){ 197 if(!!response && response.success && (response.status!== 500) && !!response.uri){
198
199 this.isNewFilePath = true;//path identifier flag
198 this.creatingNewFile = true;//flag for timeline to identify new file flow 200 this.creatingNewFile = true;//flag for timeline to identify new file flow
201
199 this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); 202 this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this));
200 }else if(!!response && !response.success){ 203 }else if(!!response && !response.success){
201 //Todo: restrict directory path to the sandbox, in the dialog itself 204 //Todo: restrict directory path to the sandbox, in the dialog itself
@@ -224,9 +227,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
224 //TODO: Add UI to handle error codes, shouldn't be alert windows 227 //TODO: Add UI to handle error codes, shouldn't be alert windows
225 if(!!response && (response.status === 204)) { 228 if(!!response && (response.status === 204)) {
226 229
227 if((typeof this.creatingNewFile === 'undefined') || (this.creatingNewFile !== true)){//not from new file flow 230 if((typeof this.isNewFilePath === 'undefined') || (this.isNewFilePath !== true)){//not from new file flow
228 this.creatingNewFile = false; 231 this.creatingNewFile = false;
229 } 232 }
233 this.isNewFilePath = false;//reset path identifier flag
230 234
231 //Sending full response object 235 //Sending full response object
232 this.openDocument(response); 236 this.openDocument(response);
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{