aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorKruti Shah2012-06-28 10:25:42 -0700
committerKruti Shah2012-06-28 10:25:42 -0700
commit3aa1242147264351b7d827fa25ecb5dc42bc2fb0 (patch)
tree0228e4d7a50540905d5052ff60f9a499fc80dc93 /js/panels
parentffb600b1919d2a101783fb6a10d1f1084bd1b032 (diff)
parent4dc91a5c7ec5ce2924357113861314ae14c2c978 (diff)
downloadninja-3aa1242147264351b7d827fa25ecb5dc42bc2fb0.tar.gz
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js65
1 files changed, 15 insertions, 50 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 45353a08..b0ab3b19 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -1211,54 +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 for(i=0;i<arrSelectedIndexesLength;i++){
1221 for(j=0;j<currentLayersSelectedLength;j++){
1222
1223 if(this.arrLayers[arrSelectedIndexes[i]] === this.arrLayers[this.currentLayersSelected[j]]){
1224 matchedValues+=1;
1225 }
1226 }
1227 }
1228
1229 if(matchedValues === arrSelectedIndexesLength){
1230 return;
1231 }
1232
1233 /*
1234 // TODO: this should probably check to see if it actually needs to run.
1235
1236 console.log(arrSelectedIndexes);
1237 console.log(this.currentLayersSelected);
1238 // Compare arrSelectedIndexes with this.currentLayersSelected
1239 // If the items are the same, we do not need to do anything.
1240 if (arrSelectedIndexesLength !== currentLayersSelectedLength) {
1241 // Different length in the arrays, we definitely need to continue.
1242 console.log('diferent length')
1243 boolContinue = true;
1244 } else {
1245 // Check each selected index and see if it's in this.currentLayersSelected
1246 // If we find one that isn't, we need to continue
1247
1248 for (i = 0; i < arrSelectedIndexesLength; i++) {
1249 console.log('checking for ', arrSelectedIndexes[i]);
1250 if (this.currentLayersSelected.indexOf(arrSelectedIndexes[i]) === -1) {
1251 // Ooops, one of them was not found.
1252 boolContinue = true;
1253 }
1254 }
1255 }
1256 if (boolContinue === false) {
1257 console.log('exiting')
1258 return;
1259 }
1260 */
1261
1262 1216
1263 // Deselect selected layers if they're not in arrSelectedIndexes. 1217 // Deselect selected layers if they're not in arrSelectedIndexes.
1264 for (i = 0; i < arrLayersLength; i++) { 1218 for (i = 0; i < arrLayersLength; i++) {
@@ -1266,16 +1220,27 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1266 if (arrSelectedIndexes.indexOf(i) < 0) { 1220 if (arrSelectedIndexes.indexOf(i) < 0) {
1267 this.arrLayers[i].layerData.isSelected = false; 1221 this.arrLayers[i].layerData.isSelected = false;
1268 this.triggerLayerBinding(i); 1222 this.triggerLayerBinding(i);
1223
1224 // Check to see if this layer, that we're deselecting, has
1225 // any selected keyframes associated with it. If it does, deselect them.
1226 for (j = 0; j < this.selectedTweens.length; j++) {
1227 var currentStageElement;
1228 if (typeof(this.selectedTweens[j].parentComponent.parentComponent.trackType) === "undefined") {
1229 currentStageElement = this.selectedTweens[j].parentComponent.parentComponent.stageElement;
1230 } else {
1231 currentStageElement = this.selectedTweens[j].parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.stageElement;
1232 }
1233 if (this.arrLayers[i].layerData.stageElement === currentStageElement) {
1234 this.selectedTweens[j].deselectTween();
1235 this.selectedTweens.splice(j, 1);
1236 }
1237 }
1269 } 1238 }
1270 } 1239 }
1271 } 1240 }
1272 if (this.currentLayersSelected !== false) { 1241 if (this.currentLayersSelected !== false) {
1273 this.currentLayersSelected = false; 1242 this.currentLayersSelected = false;
1274 } 1243 }
1275
1276 // Deselect any tweens
1277 this.deselectTweens();
1278
1279 1244
1280 // If we are actually going to be selecting things, create an empty array to use 1245 // If we are actually going to be selecting things, create an empty array to use
1281 if (arrSelectedIndexesLength > 0) { 1246 if (arrSelectedIndexesLength > 0) {