aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
authorPushkar Joshi2012-05-31 12:20:03 -0700
committerPushkar Joshi2012-05-31 12:20:03 -0700
commit4bc52365b1f81a386c3c59fd7c6ad874bb387cb5 (patch)
treec5b17297aba04bd54a59cf6214d29486e089031b /js/panels/Timeline
parent75a862d305bc4502e22bc5aa65fa271143b8cf6c (diff)
parent6042bdc5f2aada4412912fd01602d32c9088dc26 (diff)
downloadninja-4bc52365b1f81a386c3c59fd7c6ad874bb387cb5.tar.gz
Merge branch 'master' into pentool
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js10
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js21
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js14
3 files changed, 17 insertions, 28 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index b23da749..e8619d02 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -498,11 +498,7 @@ var Layer = exports.Layer = Montage.create(Component, {
498 498
499 triggerOutgoingBinding : { 499 triggerOutgoingBinding : {
500 value: function() { 500 value: function() {
501 if (this.layerData.triggerBinding === true) { 501 this.layerData.triggerBinding = !this.layerData.triggerBinding;
502 this.layerData.triggerBinding = false;
503 } else {
504 this.layerData.triggerBinding = true;
505 }
506 } 502 }
507 }, 503 },
508 /* END: Models */ 504 /* END: Models */
@@ -721,7 +717,7 @@ var Layer = exports.Layer = Montage.create(Component, {
721 this.dynamicLayerName.value = this._layerEditable.value; 717 this.dynamicLayerName.value = this._layerEditable.value;
722 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value; 718 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value;
723 this.needsDraw = true; 719 this.needsDraw = true;
724 this.application.ninja.documentController.activeDocument.needsSave = true; 720 this.application.ninja.documentController.activeDocument.model.needsSave = true;
725 } 721 }
726 }, 722 },
727 handleAddStyleClick: { 723 handleAddStyleClick: {
@@ -749,7 +745,7 @@ var Layer = exports.Layer = Montage.create(Component, {
749 this.dynamicLayerName.value = newVal; 745 this.dynamicLayerName.value = newVal;
750 this.layerName = newVal; 746 this.layerName = newVal;
751 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; 747 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal;
752 this.application.ninja.documentController.activeDocument.needsSave = true; 748 this.application.ninja.documentController.activeDocument.model.needsSave = true;
753 this.needsDraw = true; 749 this.needsDraw = true;
754 } 750 }
755 }, 751 },
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d1cab096..c55e5a24 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -110,7 +110,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
110 this._selectedLayerID = newVal; 110 this._selectedLayerID = newVal;
111 this._captureSelection = true; 111 this._captureSelection = true;
112 if (this.currentLayerSelected !== false) { 112 if (this.currentLayerSelected !== false) {
113 this.selectLayer(selectIndex, true); 113 this.selectLayer(selectIndex, false);
114 } 114 }
115 if (this.currentLayersSelected !== false) { 115 if (this.currentLayersSelected !== false) {
116 this.selectLayers(this.currentLayersSelected); 116 this.selectLayers(this.currentLayersSelected);
@@ -437,6 +437,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
437 returnObj.layerData.isVisible = true; 437 returnObj.layerData.isVisible = true;
438 returnObj.layerData.docUUID = this.application.ninja.currentDocument._uuid; 438 returnObj.layerData.docUUID = this.application.ninja.currentDocument._uuid;
439 returnObj.layerData.isTrackAnimated = false; 439 returnObj.layerData.isTrackAnimated = false;
440 returnObj.layerData.triggerBinding = false;
440 returnObj.parentElementUUID = null; 441 returnObj.parentElementUUID = null;
441 returnObj.parentElement = null; 442 returnObj.parentElement = null;
442 443
@@ -595,13 +596,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
595 596
596 // That's all we need to do for a brand new file. 597 // That's all we need to do for a brand new file.
597 // But what if we're opening an existing document? 598 // But what if we're opening an existing document?
598 if (!this.application.ninja.documentController.creatingNewFile) { 599 if (!this.application.ninja.documentController.creatingNewFile && this.application.ninja.currentDocument.currentView !== "code") {
599 // Opening an existing document. If it has DOM elements we need to restore their timeline info 600 // Opening an existing document. If it has DOM elements we need to restore their timeline info
600 if (this.application.ninja.currentDocument.documentRoot.children[0]) { 601 if (this.application.ninja.currentDocument.model.documentRoot.children[0]) {
601 // Yes, it has DOM elements. Loop through them and create a new object for each. 602 // Yes, it has DOM elements. Loop through them and create a new object for each.
602 for (myIndex = 0; this.application.ninja.currentDocument.documentRoot.children[myIndex]; myIndex++) { 603 for (myIndex = 0; this.application.ninja.currentDocument.model.documentRoot.children[myIndex]; myIndex++) {
603 this._openDoc = true; 604 this._openDoc = true;
604 this.restoreLayer(this.application.ninja.currentDocument.documentRoot.children[myIndex]); 605 this.restoreLayer(this.application.ninja.currentDocument.model.documentRoot.children[myIndex]);
605 } 606 }
606 } 607 }
607 } 608 }
@@ -994,7 +995,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
994 this.arrLayers.splice(myIndex, 0, thingToPush); 995 this.arrLayers.splice(myIndex, 0, thingToPush);
995 996
996 } 997 }
997 this.selectLayer(myIndex); 998 this.selectLayer(myIndex, false);
998 } 999 }
999 }, 1000 },
1000 1001
@@ -1402,12 +1403,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1402 // Trigger the layer/track data binding 1403 // Trigger the layer/track data binding
1403 triggerLayerBinding : { 1404 triggerLayerBinding : {
1404 value: function(intIndex) { 1405 value: function(intIndex) {
1405 if (this.arrLayers[intIndex].layerData.triggerBinding === true) { 1406 this.arrLayers[intIndex].layerData.triggerBinding = !this.arrLayers[intIndex].layerData.triggerBinding;
1406 this.arrLayers[intIndex].layerData.triggerBinding = false; 1407 }
1407 } else {
1408 this.arrLayers[intIndex].layerData.triggerBinding = true;
1409 }
1410 }
1411 }, 1408 },
1412 1409
1413 handleLayerDragStart : { 1410 handleLayerDragStart : {
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index efeeba00..ff684446 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -405,11 +405,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
405 405
406 triggerOutgoingBinding : { 406 triggerOutgoingBinding : {
407 value: function() { 407 value: function() {
408 if (this.trackData.triggerBinding === true) { 408 this.trackData.triggerBinding = !this.trackData.triggerBinding;
409 this.trackData.triggerBinding = false;
410 } else {
411 this.trackData.triggerBinding = true;
412 }
413 } 409 }
414 }, 410 },
415 411
@@ -438,7 +434,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
438 didDraw:{ 434 didDraw:{
439 value:function () { 435 value:function () {
440 if ((!this.application.ninja.documentController.creatingNewFile)||(!this.application.ninja.currentDocument.setLevel)) { 436 if ((!this.application.ninja.documentController.creatingNewFile)||(!this.application.ninja.currentDocument.setLevel)) {
441 if (this.application.ninja.currentDocument.documentRoot.children[0]) { 437 if (this.application.ninja.currentDocument.model.documentRoot.children[0]) {
442 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 438 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
443 if (selectedIndex !== false) { 439 if (selectedIndex !== false) {
444 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { 440 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) {
@@ -568,7 +564,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
568 this.nextKeyframe += 1; 564 this.nextKeyframe += 1;
569 } 565 }
570 566
571 this.application.ninja.documentController.activeDocument.needsSave = true; 567 this.application.ninja.documentController.activeDocument.model.needsSave = true;
572 } 568 }
573 }, 569 },
574 570
@@ -592,7 +588,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
592 trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); 588 trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration");
593 this.nextKeyframe = 0; 589 this.nextKeyframe = 0;
594 590
595 this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); 591 this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument.model.views.design.document);
596 592
597 for (i =0; this.currentKeyframeRule[i] ;i++) { 593 for (i =0; this.currentKeyframeRule[i] ;i++) {
598 var newTween = {}; 594 var newTween = {};
@@ -687,7 +683,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
687 keyframeString += " }"; 683 keyframeString += " }";
688 // set the keyframe string as the new rule 684 // set the keyframe string as the new rule
689 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); 685 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString);
690 this.application.ninja.documentController.activeDocument.needsSave = true; 686 this.application.ninja.documentController.activeDocument.model.needsSave = true;
691 } 687 }
692 }, 688 },
693 689