aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js22
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js4
2 files changed, 17 insertions, 9 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index fbc3edd0..af58199a 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -344,27 +344,31 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
344 addPropAnimationRuleToElement:{ 344 addPropAnimationRuleToElement:{
345 value:function(tweenEvent){ 345 value:function(tweenEvent){
346 var currentStyleValue = this.ninjaStylesContoller.getElementStyle(this.animatedElement, this.trackEditorProperty); 346 var currentStyleValue = this.ninjaStylesContoller.getElementStyle(this.animatedElement, this.trackEditorProperty);
347 if (currentStyleValue == null) {
348 currentStyleValue = "1px";
349 }
350 console.log(currentStyleValue);
351
347 this.propTweens[0].tweenData.tweenedProperties[this.trackEditorProperty] = currentStyleValue; 352 this.propTweens[0].tweenData.tweenedProperties[this.trackEditorProperty] = currentStyleValue;
348 353
354
349 this.animationName = this.animatedElement.classList[0] + "_" + this.trackEditorProperty; 355 this.animationName = this.animatedElement.classList[0] + "_" + this.trackEditorProperty;
350 var currentAnimationNameString = this.parentComponent.parentComponent.parentComponent.animationNamesString; 356 var currentAnimationNameString = this.parentComponent.parentComponent.parentComponent.animationNamesString;
351 var newAnimationNames = currentAnimationNameString + "," + this.animationName; 357 var newAnimationNames = currentAnimationNameString + "," + this.animationName;
352 //var currentAnimationDuration = this.ninjaStylesContoller.getElementStyle(this.animatedElement, "-webkit-animation-duration"); 358 var currentAnimationDuration = this.ninjaStylesContoller.getElementStyle(this.animatedElement, "-webkit-animation-duration");
353 //var newAnimationDuration = currentAnimationDuration + "," + currentAnimationDuration; 359 var newAnimationDuration = currentAnimationDuration + "," + currentAnimationDuration;
354 //var currentIterationCount = this.ninjaStylesContoller.getElementStyle(this.animatedElement, "-webkit-animation-iteration-count"); 360 var currentIterationCount = this.ninjaStylesContoller.getElementStyle(this.animatedElement, "-webkit-animation-iteration-count");
355 //var newIterationCount = currentIterationCount + ",1"; 361 var newIterationCount = currentIterationCount + ",1";
356 362
357 this.parentComponent.parentComponent.parentComponent.animationNamesString = newAnimationNames; 363 this.parentComponent.parentComponent.parentComponent.animationNamesString = newAnimationNames;
358 364
359 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", newAnimationNames); 365 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", newAnimationNames);
360 366
361 //this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", newAnimationDuration); 367 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", newAnimationDuration);
362 //this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", newIterationCount); 368 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", newIterationCount);
363 //this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-fill-mode", "both");
364 //this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-transition-timing-function", "linear");
365 369
366 var initRule = "@-webkit-keyframes " + this.animationName + " { 0% {" + this.trackEditorProperty + ": " + currentStyleValue + ";} 100% {" + this.trackEditorProperty + ": " + currentStyleValue + ";} }"; 370 var initRule = "@-webkit-keyframes " + this.animationName + " { 0% {" + this.trackEditorProperty + ": " + currentStyleValue + ";} 100% {" + this.trackEditorProperty + ": " + currentStyleValue + ";} }";
367 //console.log(initRule); 371 console.log(initRule);
368 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(initRule); 372 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(initRule);
369 373
370 this.insertPropTween(tweenEvent.offsetX); 374 this.insertPropTween(tweenEvent.offsetX);
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 835fc785..075290c7 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -820,12 +820,14 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
820 820
821 getAllAnimationRules:{ 821 getAllAnimationRules:{
822 value:function(ruleNames){ 822 value:function(ruleNames){
823 ruleNames.splice(0,1); // temp remove first animation already retrieved for main track
823 824
824 for(var i in ruleNames){ 825 for(var i in ruleNames){
825 var currentName = ruleNames[i].replace(/^\s+|\s+$/g,""); // trim whitespace 826 var currentName = ruleNames[i].replace(/^\s+|\s+$/g,""); // trim whitespace
826 var currentRule = this.application.ninja.stylesController.getAnimationRuleWithName(currentName, this.application.ninja.currentDocument._document); 827 var currentRule = this.application.ninja.stylesController.getAnimationRuleWithName(currentName, this.application.ninja.currentDocument._document);
827 this.ruleList[currentName] = currentRule; 828 this.ruleList[currentName] = currentRule;
828 } 829 }
830
829 this.recreatePropertyTracks(this.ruleList); 831 this.recreatePropertyTracks(this.ruleList);
830 } 832 }
831 }, 833 },
@@ -833,8 +835,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
833 recreatePropertyTracks:{ 835 recreatePropertyTracks:{
834 value:function(ruleSet){ 836 value:function(ruleSet){
835 837
838
836 for(var i in ruleSet){ 839 for(var i in ruleSet){
837 var styleProp = ruleSet[i][0].style[0]; 840 var styleProp = ruleSet[i][0].style[0];
841 console.log(styleProp);
838 this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp); 842 this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp);
839 } 843 }
840 844