aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js170
1 files changed, 86 insertions, 84 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 4773489c..aa900b0c 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -1056,109 +1056,111 @@ var Layer = exports.Layer = Montage.create(Component, {
1056 1056
1057 handleElementChange:{ 1057 handleElementChange:{
1058 value:function(event){ 1058 value:function(event){
1059 var el =this.layerData.stageElement; 1059 if(this.layerData){
1060 var length = this.arrLayerStyles.length , i , k=0; 1060 var el =this.layerData.stageElement;
1061 var length = this.arrLayerStyles.length , i , k=0;
1061 1062
1062 this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left")); 1063 this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left"));
1063 this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top")); 1064 this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top"));
1064 this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height")); 1065 this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height"));
1065 this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width")); 1066 this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width"));
1066 1067
1067 1068
1068 for(i=0; i<length; i++){ 1069 for(i=0; i<length; i++){
1069 if (event.detail.data.prop === "color"){ 1070 if (event.detail.data.prop === "color"){
1070 var currentValue1 = ElementsMediator.getColor(this.layerData.stageElement,event.detail.data.isFill,event.detail.data.borderSide); 1071 var currentValue1 = ElementsMediator.getColor(this.layerData.stageElement,event.detail.data.isFill,event.detail.data.borderSide);
1071 if(event.detail.data.isFill){ 1072 if(event.detail.data.isFill){
1072 while(k <length){
1073 if(this.arrLayerStyles[k].editorProperty === "background-color"){
1074 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color);
1075 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1076 break;
1077 }
1078 k++;
1079 }
1080 }else if (event.detail.data.borderSide === "bottom"){
1081 k=0;
1082 while(k <length){ 1073 while(k <length){
1083 if(this.arrLayerStyles[k].editorProperty === "bottom-border-color"){ 1074 if(this.arrLayerStyles[k].editorProperty === "background-color"){
1084 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); 1075 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color);
1085 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; 1076 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1086 break; 1077 break;
1087 } 1078 }
1088 k++; 1079 k++;
1089 } 1080 }
1090 }else if (event.detail.data.borderSide === "top"){ 1081 }else if (event.detail.data.borderSide === "bottom"){
1091 k=0; 1082 k=0;
1092 while(k <length){ 1083 while(k <length){
1093 if(this.arrLayerStyles[k].editorProperty === "top-border-color"){ 1084 if(this.arrLayerStyles[k].editorProperty === "bottom-border-color"){
1094 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); 1085 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color);
1095 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; 1086 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1096 break; 1087 break;
1088 }
1089 k++;
1097 } 1090 }
1098 k++; 1091 }else if (event.detail.data.borderSide === "top"){
1099 } 1092 k=0;
1100 }else if(event.detail.data.borderSide === "left"){ 1093 while(k <length){
1101 k=0; 1094 if(this.arrLayerStyles[k].editorProperty === "top-border-color"){
1102 while(k <length){ 1095 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color);
1103 if(this.arrLayerStyles[k].editorProperty === "left-border-color"){ 1096 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1104 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); 1097 break;
1105 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; 1098 }
1106 break; 1099 k++;
1107 } 1100 }
1108 k++; 1101 }else if(event.detail.data.borderSide === "left"){
1109 } 1102 k=0;
1110 }else if(event.detail.data.borderSide === "right"){ 1103 while(k <length){
1111 k=0; 1104 if(this.arrLayerStyles[k].editorProperty === "left-border-color"){
1112 while(k <length){ 1105 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color);
1113 if(this.arrLayerStyles[k].editorProperty === "right-border-color"){ 1106 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1114 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color); 1107 break;
1115 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty; 1108 }
1116 break; 1109 k++;
1110 }
1111 }else if(event.detail.data.borderSide === "right"){
1112 k=0;
1113 while(k <length){
1114 if(this.arrLayerStyles[k].editorProperty === "right-border-color"){
1115 this.arrLayerStyles[k].colorelement.color(currentValue1.colorMode, currentValue1.color);
1116 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1117 break;
1118 }
1119 k++;
1117 } 1120 }
1118 k++;
1119 } 1121 }
1120 } 1122 break;
1121 break; 1123 }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" ){
1122 }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" ){
1123 1124
1124 k=0; 1125 k=0;
1125 while(k <length){ 1126 while(k <length){
1126 if(this.arrLayerStyles[k].editorProperty === event.detail.data.prop){ 1127 if(this.arrLayerStyles[k].editorProperty === event.detail.data.prop){
1127 var tempElement = this.arrLayerStyles[k]; 1128 var tempElement = this.arrLayerStyles[k];
1128 1129
1129 break; 1130 break;
1131 }
1132 k++;
1130 } 1133 }
1131 k++; 1134 if(event.detail.data.prop === "background-color"){
1132 } 1135
1133 if(event.detail.data.prop === "background-color"){ 1136 var currentValue = ElementsMediator.getColor(this.layerData.stageElement,true);
1134
1135 var currentValue = ElementsMediator.getColor(this.layerData.stageElement,true);
1136 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1137 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1138 }else {
1139 if(event.detail.data.prop === "border-bottom-color"){
1140 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"bottom");
1141 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1142 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1143 }else if(event.detail.data.prop === "border-top-color"){
1144 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"top");
1145 tempElement.colorelement.color(currentValue.colorMode, currentValue.color); 1137 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1146 this.application.ninja.timeline.selectedStyle = event.detail.data.prop; 1138 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1147 }else if (event.detail.data.prop === "border-left-color"){ 1139 }else {
1148 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"left"); 1140 if(event.detail.data.prop === "border-bottom-color"){
1149 tempElement.colorelement.color(currentValue.colorMode, currentValue.color); 1141 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"bottom");
1150 this.application.ninja.timeline.selectedStyle = event.detail.data.prop; 1142 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1151 }else if (event.detail.data.prop === "border-right-color"){ 1143 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1152 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"right"); 1144 }else if(event.detail.data.prop === "border-top-color"){
1153 tempElement.colorelement.color(currentValue.colorMode, currentValue.color); 1145 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"top");
1154 this.application.ninja.timeline.selectedStyle = event.detail.data.prop; 1146 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1147 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1148 }else if (event.detail.data.prop === "border-left-color"){
1149 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"left");
1150 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1151 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1152 }else if (event.detail.data.prop === "border-right-color"){
1153 currentValue = ElementsMediator.getColor(this.layerData.stageElement,false,"right");
1154 tempElement.colorelement.color(currentValue.colorMode, currentValue.color);
1155 this.application.ninja.timeline.selectedStyle = event.detail.data.prop;
1156 }
1155 } 1157 }
1158 }else{
1159 this.arrLayerStyles[i].editorValue = parseFloat(ElementsMediator.getProperty(el, this.arrLayerStyles[i].editorProperty))
1160 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1156 } 1161 }
1157 }else{
1158 this.arrLayerStyles[i].editorValue = parseFloat(ElementsMediator.getProperty(el, this.arrLayerStyles[i].editorProperty))
1159 this.application.ninja.timeline.selectedStyle = this.arrLayerStyles[k].editorProperty;
1160 } 1162 }
1161 } 1163 }
1162 } 1164 }
1163 }, 1165 },
1164 1166