aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKruti Shah2012-06-07 21:22:41 -0700
committerKruti Shah2012-06-07 21:22:41 -0700
commit8986b9f78174b10790ad00e5a28122cb0879e5e3 (patch)
tree8a02eac0c711b7850848fada5de8c114804f51d1
parent10620ff1a9b42528d84f2c6cc4f64a1790a0d8b7 (diff)
downloadninja-8986b9f78174b10790ad00e5a28122cb0879e5e3.tar.gz
Sub property
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html7
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js127
-rw-r--r--js/panels/Timeline/Style.reel/Style.js54
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js19
4 files changed, 148 insertions, 59 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html
index 717306a0..fe3f49d2 100644
--- a/js/panels/Timeline/Layer.reel/Layer.html
+++ b/js/panels/Timeline/Layer.reel/Layer.html
@@ -110,7 +110,12 @@
110 "boundObject" : {"@": "repetition1"}, 110 "boundObject" : {"@": "repetition1"},
111 "boundObjectPropertyPath" : "objectAtCurrentIteration.ruleTweener", 111 "boundObjectPropertyPath" : "objectAtCurrentIteration.ruleTweener",
112 "oneway" : false 112 "oneway" : false
113 } 113 },
114 "abcelement" : {
115 "boundObject" : {"@": "repetition1"},
116 "boundObjectPropertyPath" : "objectAtCurrentIteration.abcelement",
117 "oneway" : false
118 }
114 } 119 }
115 }, 120 },
116 "dtext_position_x" : { 121 "dtext_position_x" : {
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index da9845d6..23ba1ef9 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -543,13 +543,11 @@ var Layer = exports.Layer = Montage.create(Component, {
543 this.heightControl.addEventListener("changing",this,false); 543 this.heightControl.addEventListener("changing",this,false);
544 this.heightControl.addEventListener("change",this,false); 544 this.heightControl.addEventListener("change",this,false);
545 545
546// el=this.layerData.stageElement; 546 el=this.layerData.stageElement;
547// debugger; 547 this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left"));
548// 548 this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top"));
549// this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left")); 549 this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height"));
550// this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top")); 550 this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width"));
551// this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height"));
552// this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width"));
553 } 551 }
554 }, 552 },
555 553
@@ -656,6 +654,7 @@ var Layer = exports.Layer = Montage.create(Component, {
656 newStyle.editorValue = ""; 654 newStyle.editorValue = "";
657 newStyle.ruleTweener = false; 655 newStyle.ruleTweener = false;
658 newStyle.isSelected = false; 656 newStyle.isSelected = false;
657 newStyle.abcelement = "";
659 this.arrLayerStyles.push(newStyle); 658 this.arrLayerStyles.push(newStyle);
660 659
661 // Set up the event info and dispatch the event 660 // Set up the event info and dispatch the event
@@ -915,52 +914,107 @@ var Layer = exports.Layer = Montage.create(Component, {
915 } 914 }
916 }, 915 },
917 916
918 handleLeftChange:{ 917 handleLeftChange: {
919 value:function(event){ 918 value: function(event) {
920 debugger; 919 var prevPosition;
921 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Change", "timeline"); 920 if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){
921 if(!event.wasSetByCode) {
922 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
923 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "pi", prevPosition);
924 this.savedPosition = null;
925 }
926
927 }
922 } 928 }
923 }, 929 },
924 930
925 handleTopChange:{ 931 handleTopChange: {
926 value:function(){ 932 value: function(event) {
927 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "top", [this.dtextPositionY + "px"] , "Change", "timeline"); 933 var prevPosition;
934 if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){
935 if(!event.wasSetByCode) {
936 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
937
938 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "pi", prevPosition);
939 this.savedPosition = null;
940 }
941 }
928 } 942 }
929 }, 943 },
930 944
931 handleWidthChange:{ 945 handleWidthChange:{
932 value:function(){ 946 value: function(event) {
933 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "width", [this.dtextScaleX + "px"] , "Change", "timeline"); 947 var prevPosition;
948 if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){
949 if(!event.wasSetByCode) {
950 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
951
952 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "pi", prevPosition);
953 this.savedPosition = null;
954 }
955 }
934 } 956 }
935 }, 957 },
936 958
937 handleHeightChange:{ 959 handleHeightChange:{
938 value:function(){ 960 value: function(event) {
939 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline"); 961 var prevPosition;
962 if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){
963 if(!event.wasSetByCode) {
964 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
965
966 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "pi", prevPosition);
967 this.savedPosition = null;
968 }
969 }
940 } 970 }
941 }, 971 },
942 972
943 handleLeftChanging:{ 973 handleLeftChanging: {
944 value:function(){ 974 value: function(event) {
945 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "left", [this.dtextPositionX + "px"] , "Changing", "timeline"); 975 if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){
976 if(!event.wasSetByCode) {
977 if(!this.savedPosition) this.savedPosition = this.leftPosition;
978 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "pi");
979 }
980 }
981
946 } 982 }
947 }, 983 },
948 984
949 handleTopChanging:{ 985 handleTopChanging: {
950 value:function(){ 986 value: function(event) {
951 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "top", [this.dtextPositionY + "px"] , "Changing", "timeline"); 987 if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){
988 if(!event.wasSetByCode) {
989 if(!this.savedPosition) this.savedPosition = this.topPosition;
990 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "pi");
991 }
992 }
993
952 } 994 }
953 }, 995 },
954 996
955 handleWidthChanging:{ 997 handleWidthChanging:{
956 value:function(){ 998 value: function(event) {
957 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); 999 if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){
1000 if(!event.wasSetByCode) {
1001 if(!this.savedPosition) this.savedPosition = this.dtextScaleX;
1002 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "pi");
1003 }
1004 }
1005
958 } 1006 }
959 }, 1007 },
960 1008
961 handleHeightChanging:{ 1009 handleHeightChanging:{
962 value:function(){ 1010 value: function(event) {
963 this.application.ninja.elementMediator.setProperty(this.layerData.stageElement, "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); 1011 if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){
1012 if(!event.wasSetByCode) {
1013 if(!this.savedPosition) this.savedPosition = this.dtextScaleY;
1014 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "pi");
1015 }
1016 }
1017
964 } 1018 }
965 }, 1019 },
966 1020
@@ -970,20 +1024,29 @@ var Layer = exports.Layer = Montage.create(Component, {
970 var el =this.layerData.stageElement; 1024 var el =this.layerData.stageElement;
971 var length = this.arrLayerStyles.length , i; 1025 var length = this.arrLayerStyles.length , i;
972 1026
973 if(event.detail.source && event.detail.source!== "timeline"){
974 this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left")); 1027 this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left"));
975 this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top")); 1028 this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top"));
976 this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height")); 1029 this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height"));
977 this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width")); 1030 this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width"));
978 1031
979 for(i=0; i<length; i++){ 1032 for(i=0; i<length; i++){
980 if(event.detail.data.prop === this.arrLayerStyles[i].editorProperty){ 1033 if(event.detail.data.prop === "background-color"){
981 this.arrLayerStyles[i].editorValue = parseFloat(ElementsMediator.getProperty(el, this.arrLayerStyles[i].editorProperty)); 1034 var currentValue = ElementsMediator.getColor(this.layerData.stageElement,true);
1035 this.arrLayerStyles[0].abcelement.color(currentValue.colorMode, currentValue.color);
982 break; 1036 break;
1037 }else{
1038 this.arrLayerStyles[i].editorValue = parseFloat(ElementsMediator.getProperty(el, this.arrLayerStyles[i].editorProperty))
983 }