diff options
author | Valerio Virgillito | 2012-02-29 12:05:48 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-29 12:05:48 -0800 |
commit | 850f3a1f7ab81ec80b6de1c49f2d2bbcbfe87c8e (patch) | |
tree | e7b3b3cf858086589008d4ce8552264249f6e4ed /js/panels/Timeline/TimelinePanel.reel | |
parent | 1568367213e760463f3ee29a531aa345fda6bd6d (diff) | |
parent | 5f777eb88c6af30f4f22078bc18da2a5ce346b84 (diff) | |
download | ninja-850f3a1f7ab81ec80b6de1c49f2d2bbcbfe87c8e.tar.gz |
Merge pull request #86 from imix23ways/Timeline
Timeline
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 27 |
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 | } |