diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 122 |
1 files changed, 100 insertions, 22 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 23ba1ef9..629b118c 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -654,7 +654,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
654 | newStyle.editorValue = ""; | 654 | newStyle.editorValue = ""; |
655 | newStyle.ruleTweener = false; | 655 | newStyle.ruleTweener = false; |
656 | newStyle.isSelected = false; | 656 | newStyle.isSelected = false; |
657 | newStyle.abcelement = ""; | 657 | newStyle.colorelement = ""; |
658 | this.arrLayerStyles.push(newStyle); | 658 | this.arrLayerStyles.push(newStyle); |
659 | 659 | ||
660 | // Set up the event info and dispatch the event | 660 | // Set up the event info and dispatch the event |
@@ -920,7 +920,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
920 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ | 920 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ |
921 | if(!event.wasSetByCode) { | 921 | if(!event.wasSetByCode) { |
922 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 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); | 923 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition); |
924 | this.savedPosition = null; | 924 | this.savedPosition = null; |
925 | } | 925 | } |
926 | 926 | ||
@@ -935,7 +935,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
935 | if(!event.wasSetByCode) { | 935 | if(!event.wasSetByCode) { |
936 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 936 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
937 | 937 | ||
938 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "pi", prevPosition); | 938 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition); |
939 | this.savedPosition = null; | 939 | this.savedPosition = null; |
940 | } | 940 | } |
941 | } | 941 | } |
@@ -949,7 +949,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
949 | if(!event.wasSetByCode) { | 949 | if(!event.wasSetByCode) { |
950 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 950 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
951 | 951 | ||
952 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "pi", prevPosition); | 952 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition); |
953 | this.savedPosition = null; | 953 | this.savedPosition = null; |
954 | } | 954 | } |
955 | } | 955 | } |
@@ -963,7 +963,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
963 | if(!event.wasSetByCode) { | 963 | if(!event.wasSetByCode) { |
964 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 964 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
965 | 965 | ||
966 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "pi", prevPosition); | 966 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition); |
967 | this.savedPosition = null; | 967 | this.savedPosition = null; |
968 | } | 968 | } |
969 | } | 969 | } |
@@ -972,10 +972,11 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
972 | 972 | ||
973 | handleLeftChanging: { | 973 | handleLeftChanging: { |
974 | value: function(event) { | 974 | value: function(event) { |
975 | |||
975 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ | 976 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ |
976 | if(!event.wasSetByCode) { | 977 | if(!event.wasSetByCode) { |
977 | if(!this.savedPosition) this.savedPosition = this.leftPosition; | 978 | if(!this.savedPosition) this.savedPosition = this.leftPosition; |
978 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "pi"); | 979 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline"); |
979 | } | 980 | } |
980 | } | 981 | } |
981 | 982 | ||
@@ -987,7 +988,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
987 | if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ | 988 | if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ |
988 | if(!event.wasSetByCode) { | 989 | if(!event.wasSetByCode) { |
989 | if(!this.savedPosition) this.savedPosition = this.topPosition; | 990 | if(!this.savedPosition) this.savedPosition = this.topPosition; |
990 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "pi"); | 991 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline"); |
991 | } | 992 | } |
992 | } | 993 | } |
993 | 994 | ||
@@ -999,7 +1000,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
999 | if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ | 1000 | if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ |
1000 | if(!event.wasSetByCode) { | 1001 | if(!event.wasSetByCode) { |
1001 | if(!this.savedPosition) this.savedPosition = this.dtextScaleX; | 1002 | if(!this.savedPosition) this.savedPosition = this.dtextScaleX; |
1002 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "pi"); | 1003 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); |
1003 | } | 1004 | } |
1004 | } | 1005 | } |
1005 | 1006 | ||
@@ -1011,7 +1012,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1011 | if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ | 1012 | if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ |
1012 | if(!event.wasSetByCode) { | 1013 | if(!event.wasSetByCode) { |
1013 | if(!this.savedPosition) this.savedPosition = this.dtextScaleY; | 1014 | if(!this.savedPosition) this.savedPosition = this.dtextScaleY; |
1014 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "pi"); | 1015 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); |
1015 | } | 1016 | } |
1016 | } | 1017 | } |
1017 | 1018 | ||
@@ -1022,33 +1023,110 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1022 | handleElementChange:{ | 1023 | handleElementChange:{ |
1023 | value:function(event){ | 1024 | value:function(event){ |
1024 | var el =this.layerData.stageElement; | 1025 | var el =this.layerData.stageElement; |
1025 | var length = this.arrLayerStyles.length , i; | 1026 | var length = this.arrLayerStyles.length , i , k=0; |
1026 | 1027 | ||
1027 | this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left")); | 1028 | this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left")); |
1028 | this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top")); | 1029 | this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top")); |
1029 | this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height")); | 1030 | this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height")); |
1030 | this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width")); | 1031 | this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width")); |
1031 | 1032 | ||
1033 | |||
1032 | for(i=0; i<length; i++){ | 1034 | for(i=0; i<length; i++){ |
1033 | if(event.detail.data.prop === "background-color"){ | 1035 | if (event.detail.data.prop === "color"){ |
1034 | var currentValue = ElementsMediator.getColor(this.layerData.stageElement,true); | 1036 | var currentValue1 = ElementsMediator.getColor(this.layerData.stageElement,event.detail.data.isFill,event.detail.data.borderSide); |
1035 | this.arrLayerStyles[0].abcelement.color(currentValue.colorMode, currentValue.color); | 1037 | if(event.detail.data.isFill){ |
1038 | while(k <length){ | ||
1039 | if(this.arrLayerStyles[k].editorProperty === "background-color"){ | ||
1040 | this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); | ||
1041 | this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; | ||
1042 | break; | ||
1043 | } | ||
1044 | k++; | ||
1045 | } | ||
1046 | }else if (event.detail.data.borderSide === "bottom"){ | ||
1047 | k=0; | ||
1048 | while(k <length){ | ||
1049 | if(this.arrLayerStyles[k].editorProperty === "bottom-border-color"){ | ||
1050 | this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); | ||
1051 | this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; | ||
1052 | break; | ||
1053 | } | ||
1054 | k++; | ||
1055 | } | ||
1056 | }else if (event.detail.data.borderSide === "top"){ | ||
1057 | k=0; | ||
1058 | while(k <length){ | ||
1059 | if(this.arrLayerStyles[k].editorProperty === "top-border-color"){ | ||
1060 | this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); | ||
1061 | this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; | ||
1062 | break; | ||
1063 | } | ||
1064 | k++; | ||
1065 | } | ||
1066 | }else if(event.detail.data.borderSide === "left"){ | ||
1067 | k=0; | ||
1068 | while(k <length){ | ||
1069 | if(this.arrLayerStyles[k].editorProperty === "left-border-color"){ | ||
1070 | this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); | ||
1071 | this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; | ||
1072 | break; | ||
1073 | } | ||
1074 | k++; | ||
1075 | } | ||
1076 | }else if(event.detail.data.borderSide === "right"){ | ||
1077 | k=0; | ||
1078 | while(k <length){ | ||
1079 | if(this.arrLayerStyles[k].editorProperty === "right-border-color"){ | ||
1080 | this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); | ||
1081 | this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; | ||
1082 | break; | ||
1083 | } | ||
1084 | k++; | ||
1085 | } | ||
1086 | } | ||
1036 | break; | 1087 | break; |
1088 | }else if (event.detail.source === "tween" || event.detail.data.prop === "background-color" ||event.detail.data.prop === "border-top-color"|| event.detail.data.prop === "border-right-color"|| event.detail.data.prop === "border-left-color" || event.detail.data.prop === "border-bottom-color" ){ | ||
1089 | |||
1090 | k=0; | ||
1091 | while(k <length){ | ||
1092 | if(this.arrLayerStyles[k].editorProperty === event.detail.data.prop){ | ||
1093 | var tempElement = this.arrLayerStyles[k]; | ||
1094 | |||
1095 | break; | ||
1096 | } | ||
1097 | k++; | ||
1098 | } | ||
1099 | if(event.detail.data.prop === "background-color"){ | ||
1100 | |||
1101 | var currentValue = ElementsMediator.getColor(this.layerData.stageElement,true); | ||
1102 | tempElement.colorelement.color(currentValue.colorMode, currentValue.color); | ||
1103 | this.application.ninja.timeline.selectedStyle = event.detail.data.prop; | ||
1104 | }else { | ||
1105 | if(event.detail.data.prop === "border-bottom-color"){ | ||
1106 | currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"bottom"); | ||