diff options
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 85 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 61 |
2 files changed, 37 insertions, 109 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index b4833fa2..4dd9e88a 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -1046,28 +1046,25 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1046 | 1046 | ||
1047 | handleLeftChange: { | 1047 | handleLeftChange: { |
1048 | value: function(event) { | 1048 | value: function(event) { |
1049 | var prevPosition; | ||
1050 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1051 | if(!event.wasSetByCode) { | ||
1052 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1053 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition); | ||
1054 | this.savedPosition = null; | ||
1055 | } | ||
1056 | 1049 | ||
1050 | var prevPosition; | ||
1051 | if(!event.wasSetByCode) { | ||
1052 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1053 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition); | ||
1054 | this.savedPosition = null; | ||
1057 | } | 1055 | } |
1058 | } | 1056 | } |
1059 | }, | 1057 | }, |
1060 | 1058 | ||
1061 | handleTopChange: { | 1059 | handleTopChange: { |
1062 | value: function(event) { | 1060 | value: function(event) { |
1063 | var prevPosition; | 1061 | var prevPosition; |
1064 | if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1065 | if(!event.wasSetByCode) { | ||
1066 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1067 | 1062 | ||
1068 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition); | 1063 | if(!event.wasSetByCode) { |
1069 | this.savedPosition = null; | 1064 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
1070 | } | 1065 | |
1066 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition); | ||
1067 | this.savedPosition = null; | ||
1071 | } | 1068 | } |
1072 | } | 1069 | } |
1073 | }, | 1070 | }, |
@@ -1075,13 +1072,12 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1075 | handleWidthChange:{ | 1072 | handleWidthChange:{ |
1076 | value: function(event) { | 1073 | value: function(event) { |
1077 | var prevPosition; | 1074 | var prevPosition; |
1078 | if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1079 | if(!event.wasSetByCode) { | ||
1080 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1081 | 1075 | ||
1082 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition); | 1076 | if(!event.wasSetByCode) { |
1083 | this.savedPosition = null; | 1077 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
1084 | } | 1078 | |
1079 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition); | ||
1080 | this.savedPosition = null; | ||
1085 | } | 1081 | } |
1086 | } | 1082 | } |
1087 | }, | 1083 | }, |
@@ -1089,13 +1085,12 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1089 | handleHeightChange:{ | 1085 | handleHeightChange:{ |
1090 | value: function(event) { | 1086 | value: function(event) { |
1091 | var prevPosition; | 1087 | var prevPosition; |
1092 | if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1093 | if(!event.wasSetByCode) { | ||
1094 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1095 | 1088 | ||
1096 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition); | 1089 | if(!event.wasSetByCode) { |
1097 | this.savedPosition = null; | 1090 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
1098 | } | 1091 | |
1092 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition); | ||
1093 | this.savedPosition = null; | ||
1099 | } | 1094 | } |
1100 | } | 1095 | } |
1101 | }, | 1096 | }, |
@@ -1103,11 +1098,9 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1103 | handleLeftChanging: { | 1098 | handleLeftChanging: { |
1104 | value: function(event) { | 1099 | value: function(event) { |
1105 | 1100 | ||
1106 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ | 1101 | if(!event.wasSetByCode) { |
1107 | if(!event.wasSetByCode) { | 1102 | if(!this.savedPosition) this.savedPosition = this.leftPosition; |
1108 | if(!this.savedPosition) this.savedPosition = this.leftPosition; | 1103 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline"); |
1109 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline"); | ||
1110 | } | ||
1111 | } | 1104 | } |
1112 | 1105 | ||
1113 | } | 1106 | } |
@@ -1115,37 +1108,31 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1115 | 1108 | ||
1116 | handleTopChanging: { | 1109 | handleTopChanging: { |
1117 | value: function(event) { | 1110 | value: function(event) { |
1118 | if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1119 | if(!event.wasSetByCode) { | ||
1120 | if(!this.savedPosition) this.savedPosition = this.topPosition; | ||
1121 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline"); | ||
1122 | } | ||
1123 | } | ||
1124 | 1111 | ||
1112 | if(!event.wasSetByCode) { | ||
1113 | if(!this.savedPosition) this.savedPosition = this.topPosition; | ||
1114 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline"); | ||
1115 | } | ||
1125 | } | 1116 | } |
1126 | }, | 1117 | }, |
1127 | 1118 | ||
1128 | handleWidthChanging:{ | 1119 | handleWidthChanging:{ |
1129 | value: function(event) { | 1120 | value: function(event) { |
1130 | if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1131 | if(!event.wasSetByCode) { | ||
1132 | if(!this.savedPosition) this.savedPosition = this.dtextScaleX; | ||
1133 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); | ||
1134 | } | ||
1135 | } | ||
1136 | 1121 | ||
1122 | if(!event.wasSetByCode) { | ||
1123 | if(!this.savedPosition) this.savedPosition = this.dtextScaleX; | ||
1124 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); | ||
1125 | } | ||
1137 | } | 1126 | } |
1138 | }, | 1127 | }, |
1139 | 1128 | ||
1140 | handleHeightChanging:{ | 1129 | handleHeightChanging:{ |
1141 | value: function(event) { | 1130 | value: function(event) { |
1142 | if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1143 | if(!event.wasSetByCode) { | ||
1144 | if(!this.savedPosition) this.savedPosition = this.dtextScaleY; | ||
1145 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); | ||
1146 | } | ||
1147 | } | ||
1148 | 1131 | ||
1132 | if(!event.wasSetByCode) { | ||
1133 | if(!this.savedPosition) this.savedPosition = this.dtextScaleY; | ||
1134 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); | ||
1135 | } | ||
1149 | } | 1136 | } |
1150 | }, | 1137 | }, |
1151 | 1138 | ||
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 3d31a50b..b0ab3b19 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -1211,63 +1211,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1211 | j = 0, | 1211 | j = 0, |
1212 | arrLayersLength = this.arrLayers.length, | 1212 | arrLayersLength = this.arrLayers.length, |
1213 | arrSelectedIndexesLength = arrSelectedIndexes.length, | 1213 | arrSelectedIndexesLength = arrSelectedIndexes.length, |
1214 | currentLayersSelectedLength = this.currentLayersSelected.length, | ||
1215 | boolContinue = false, | ||
1216 | arrSelectedLayers = false, | 1214 | arrSelectedLayers = false, |
1217 | arrCurrentElementsSelected = []; | 1215 | arrCurrentElementsSelected = []; |
1218 | var matchedValues = 0; | ||
1219 | |||
1220 | /* | ||
1221 | if (arrSelectedIndexesLength !== 0) { | ||
1222 | for(i=0;i<arrSelectedIndexesLength;i++){ | ||
1223 | for(j=0;j<currentLayersSelectedLength;j++){ | ||
1224 | |||
1225 | if(this.arrLayers[arrSelectedIndexes[i]] === this.arrLayers[this.currentLayerSelected[j]]){ | ||
1226 | matchedValues+=1; | ||
1227 | } | ||
1228 | } | ||
1229 | } | ||
1230 | |||
1231 | if(matchedValues === arrSelectedIndexesLength){ | ||
1232 | return; | ||
1233 | } | ||
1234 | } | ||
1235 | |||
1236 | if(this.arrLayers[arrSelectedIndexes[i]] === this.arrLayers[this.currentLayersSelected[j]]){ | ||
1237 | matchedValues+=1; | ||
1238 | } | ||
1239 | } | ||
1240 | } | ||
1241 | |||
1242 | |||
1243 | // TODO: this should probably check to see if it actually needs to run. | ||
1244 | |||
1245 | console.log(arrSelectedIndexes); | ||
1246 | console.log(this.currentLayersSelected); | ||
1247 | // Compare arrSelectedIndexes with this.currentLayersSelected | ||
1248 | // If the items are the same, we do not need to do anything. | ||
1249 | if (arrSelectedIndexesLength !== currentLayersSelectedLength) { | ||
1250 | // Different length in the arrays, we definitely need to continue. | ||
1251 | console.log('diferent length') | ||
1252 | boolContinue = true; | ||
1253 | } else { | ||
1254 | // Check each selected index and see if it's in this.currentLayersSelected | ||
1255 | // If w |