From 0b0ad28a216d839aab37b2563912bb82f79768d1 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 27 Jun 2012 12:08:54 -0700 Subject: Fix animation names breaking Signed-off-by: Jonathan Duran --- js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 9 +++++++-- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index 31ba8253..72d26e78 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js @@ -470,13 +470,18 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { this.animationName = this.animatedElement.classList[0] + "_" + this.trackEditorProperty; var currentAnimationNameString = this.parentComponent.parentComponent.parentComponent.parentComponent.animationNamesString; - var newAnimationNames = currentAnimationNameString + "," + this.animationName; + var newAnimationNames = ""; + if(currentAnimationNameString.length == 0){ + newAnimationNames = this.animationName; + } else { + newAnimationNames = currentAnimationNameString + "," + this.animationName; + } var currentAnimationDuration = this.ninjaStylesContoller.getElementStyle(this.animatedElement, "-webkit-animation-duration"); var newAnimationDuration = currentAnimationDuration + "," + currentAnimationDuration; var currentIterationCount = this.ninjaStylesContoller.getElementStyle(this.animatedElement, "-webkit-animation-iteration-count"); var newIterationCount = currentIterationCount + ",1"; - this.parentComponent.parentComponent.parentComponent.animationNamesString = newAnimationNames; + this.parentComponent.parentComponent.parentComponent.parentComponent.animationNamesString = newAnimationNames; this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", newAnimationNames); this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", newAnimationDuration); diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 014d3f34..26ce526f 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -1063,8 +1063,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.tweens[0].tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight + "px"; var animationDuration = Math.round(this.trackDuration / 1000) + "s"; this.animationName = this.animatedElement.classList[0] + "_PositionSize"; - this.animationNamesString = this.animationName; - this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationName); + if(this.animationNamesString.length == 0){ + this.animationNamesString = this.animationName; + } else { + this.animationNamesString = this.animationName + ", " + this.animationNamesString; + } + this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationNamesString); this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration); this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-fill-mode", "forwards"); this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", 1); -- cgit v1.2.3