aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKruti Shah2012-04-06 12:08:34 -0700
committerKruti Shah2012-04-06 12:08:34 -0700
commit42263492bc748df857cbf7e5dfa14977c707df4d (patch)
tree42be7d1d8247c2af86a1f6914198a74b9cda47e8
parent852f49888e54b4a2a8ee929dbeb0c54dfa004de6 (diff)
downloadninja-42263492bc748df857cbf7e5dfa14977c707df4d.tar.gz
Timeline : Deleting of layers. And master duration track updating with deletion of layers
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js46
1 files changed, 39 insertions, 7 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 2df447db..20e217e9 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -831,12 +831,43 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
831 }, 831 },
832 832
833 deleteLayer:{ 833 deleteLayer:{
834 value:function (object) { 834 value:function (elements) {
835 // Only delete a selected layer. If no layer is selected, do nothing. 835 // Only delete a selected layer. If no layer is selected, do nothing.
836 if (this.layerRepetition.selectedIndexes.length > 0) { 836 var length = elements.length;
837 // Delete the selected layer. 837
838 var myIndex = this.layerRepetition.selectedIndexes[0]; 838 while(length>0){
839 this.arrLayers.splice(myIndex, 1); 839 if (this.layerRepetition.selectedIndexes.length > 0) {
840 // Delete the selected layer.
841 var myIndex = this.layerRepetition.selectedIndexes[0];
842 this.arrLayers.splice(myIndex, 1);
843 var selectIndex = this.arrLayers.length;
844 this.searchHighestTrackDuration();
845 if(selectIndex>0){
846 this.selectLayer(selectIndex-1);
847 }
848 length--;
849 }
850 }
851 }
852 },
853
854 searchHighestTrackDuration:{
855 value:function(){
856
857 var trackDuration;
858 var length = this.arrLayers.length;
859 if(length > 0){
860 trackDuration = this.arrLayers[length-1].layerData.trackDuration;
861 length--;
862 while(length >=0){
863 if(this.arrLayers[length].layerData.trackDuration > trackDuration){
864 trackDuration = this.arrLayers[length].layerData.trackDuration;
865 }
866 length--;
867 }
868 this.masterDuration = trackDuration;
869 }else{
870 this.masterDuration = 0 ;
840 } 871 }
841 } 872 }
842 }, 873 },
@@ -850,8 +881,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
850 }, 881 },
851 882
852 handleElementsRemoved:{ 883 handleElementsRemoved:{
853 value:function () { 884 value:function (event) {
854 this.deleteLayer(); 885 var deleteElements = event.detail;
886 this.deleteLayer(deleteElements);
855 } 887 }
856 }, 888 },
857 889