diff options
Diffstat (limited to 'js/panels')
4 files changed, 40 insertions, 6 deletions
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js index 3cbd4369..003724bb 100755 --- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js | |||
@@ -45,7 +45,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
45 | }, | 45 | }, |
46 | 46 | ||
47 | initPanelOrder: { | 47 | initPanelOrder: { |
48 | value: ['PropertiesPanel','ColorPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel'] | 48 | value: ['ColorPanel', 'PropertiesPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel'] |
49 | }, | 49 | }, |
50 | 50 | ||
51 | panelOrder: { | 51 | panelOrder: { |
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 | } |
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{ |
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 8fa33a75..cc9ec96a 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js | |||
@@ -55,6 +55,7 @@ exports.Content = Montage.create(Component, { | |||
55 | } | 55 | } |
56 | 56 | ||
57 | this.eventManager.addEventListener("openDocument", this, false); | 57 | this.eventManager.addEventListener("openDocument", this, false); |
58 | this.eventManager.addEventListener("switchDocument", this, false); | ||
58 | } | 59 | } |
59 | }, | 60 | }, |
60 | 61 | ||
@@ -74,6 +75,21 @@ exports.Content = Montage.create(Component, { | |||
74 | } | 75 | } |
75 | }, | 76 | }, |
76 | 77 | ||
78 | handleSwitchDocument: { | ||
79 | value: function(){ | ||
80 | // For now always assume that the stage is selected by default | ||
81 | if(this.application.ninja.selectedElements.length === 0) { | ||
82 | this.displayStageProperties(); | ||
83 | }else { | ||
84 | if(this.application.ninja.selectedElements.length === 1) { | ||
85 | this.displayElementProperties(this.application.ninja.selectedElements[0]._element); | ||
86 | } else { | ||
87 | this.displayGroupProperties(this.application.ninja.selectedElements); | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | }, | ||
92 | |||
77 | /** | 93 | /** |
78 | * Blur and Key up to handle change in the Element ID field. | 94 | * Blur and Key up to handle change in the Element ID field. |
79 | */ | 95 | */ |