aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
authorJonathan Duran2012-07-02 09:17:24 -0700
committerJonathan Duran2012-07-02 09:17:24 -0700
commitff4ac4add41982414794dd94cab478cf75bd778a (patch)
treea5d86025673287bd213d027255cee427260993de /js/panels/Timeline
parent2bba5361f817e96b4f84bdf5e472358da3dcec77 (diff)
parentf065c2bc664e9c8e4e97f8b6f6b684c310233f89 (diff)
downloadninja-ff4ac4add41982414794dd94cab478cf75bd778a.tar.gz
Merge branch 'refs/heads/timeline-local' into TimelineUber
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js39
1 files changed, 25 insertions, 14 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index b0ab3b19..7deaf0d1 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -1368,9 +1368,23 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1368 arrLayersLength = arrLayers.length, 1368 arrLayersLength = arrLayers.length,
1369 targetIndex = 0, 1369 targetIndex = 0,
1370 isAlreadySelected = false, 1370 isAlreadySelected = false,
1371 indexAlreadySelected = 0, 1371 indexAlreadySelected = -5,
1372 indexLastClicked = 0; 1372 indexLastClicked = 0,
1373 ua = navigator.userAgent.toLowerCase(),
1374 boolCommandControlKeyIsPressed = false;
1375
1376 // Check to see if either the Command key (macs) or Control key (windows) is being pressed
1377 if (ua.indexOf("mac") > -1) {
1378 if (event.metaKey === true) {
1379 boolCommandControlKeyIsPressed = true;
1380 }
1381 } else {
1382 if (this._isControlPressed === true) {
1383 boolCommandControlKeyIsPressed = true;
1384 }
1385 }
1373 1386
1387
1374 // Did the mousedown event originate within a layer? 1388 // Did the mousedown event originate within a layer?
1375 if (ptrParent === false) { 1389 if (ptrParent === false) {
1376 // No it did not. Do nothing. 1390 // No it did not. Do nothing.
@@ -1387,17 +1401,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1387 1401
1388 // Did we just click on a layer that's already selected? 1402 // Did we just click on a layer that's already selected?
1389 if (this.currentLayersSelected !== false) { 1403 if (this.currentLayersSelected !== false) {
1390 indexAlreadySelected = this.currentLayersSelected.indexOf(targetIndex); 1404 for (i = 0; i < this.currentLayersSelected.length; i++) {
1405 if (this.currentLayersSelected[i] === targetIndex) {
1406 indexAlreadySelected = i;
1407 }
1408 }
1391 } 1409 }
1392 if (indexAlreadySelected > -1) { 1410 if (indexAlreadySelected > -1) {
1393 isAlreadySelected = true; 1411 isAlreadySelected = true;
1394 } 1412 }
1395
1396 /*
1397 if (targetIndex > -1) {
1398 indexLastClicked = targetIndex;
1399 }
1400 */
1401 1413
1402 // Now, do the selection based on all of that information. 1414 // Now, do the selection based on all of that information.
1403 if (this.currentLayersSelected.length === 0) { 1415 if (this.currentLayersSelected.length === 0) {
@@ -1406,13 +1418,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1406 } else { 1418 } else {
1407 // Something is already selected. What do do depends on whether 1419 // Something is already selected. What do do depends on whether
1408 // or not other keys are pressed. 1420 // or not other keys are pressed.
1409 if (this._isControlPressed === true) { 1421 if (boolCommandControlKeyIsPressed === true) {
1410 // Control key is being pressed, so we need to 1422 // Control or Command key is being pressed, so we need to
1411 // either add the current layer to selectedLayers 1423 // either add the current layer to selectedLayers
1412 // or remove it if it's already there. 1424 // or remove it if it's already there.
1413 if (this.currentLayersSelected === false) { 1425 if (this.currentLayersSelected === false) {
1414 this.currentLayersSelected = []; 1426 this.currentLayersSelected = [];
1415 //this.currentLayerSelected = false;
1416 } 1427 }
1417 if (isAlreadySelected === false) { 1428 if (isAlreadySelected === false) {
1418 this.currentLayersSelected.push(targetIndex); 1429 this.currentLayersSelected.push(targetIndex);
@@ -1444,9 +1455,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1444 this.currentLayersSelected = [targetIndex]; 1455 this.currentLayersSelected = [targetIndex];
1445 this.lastLayerClicked = targetIndex; 1456 this.lastLayerClicked = targetIndex;
1446 } 1457 }
1447
1448 } 1458 }
1449 //this._captureSelection = true;
1450 this.selectLayers(this.currentLayersSelected); 1459 this.selectLayers(this.currentLayersSelected);
1451 this.updateStageSelection(); 1460 this.updateStageSelection();
1452 } 1461 }
@@ -1467,9 +1476,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1467 // Control key has been pressed 1476 // Control key has been pressed
1468 this._isControlPressed = true; 1477 this._isControlPressed = true;
1469 } 1478 }
1479 /*
1470 if (event.metaKey === true) { 1480 if (event.metaKey === true) {
1471 this._isControlPressed = true; 1481 this._isControlPressed = true;
1472 } 1482 }
1483 */
1473 } 1484 }
1474 }, 1485 },
1475 1486