Skip to content

Commit

Permalink
fix(animation): fix default animation duration in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
solkimicreb committed Dec 3, 2016
1 parent be6a612 commit b3fa9e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middlewares/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function enterAttribute (animation) {
if (this[secret.entering] !== false) {
this[secret.entering] = true
if (typeof animation === 'object' && animation !== null) {
this.style.animation = animationObjectToString (animation)
this.style.animation = animationObjectToString(animation)
} else if (typeof animation === 'string') {
this.style.animation = animation
}
Expand All @@ -55,7 +55,7 @@ function leaveAttribute (animation) {
this.$cleanup(() => {
this[secret.leaving] = true
if (typeof animation === 'object' && animation !== null) {
this.style.animation = animationObjectToString (animation)
this.style.animation = animationObjectToString(animation)
} else if (typeof animation === 'string') {
this.style.animation = animation
}
Expand Down Expand Up @@ -150,7 +150,7 @@ function transitionObjectToString (transition) {

function setAnimationDefaults (elem) {
const style = elem.style
if (style.animationDuration === 'initial' || style.animationDuration === '') {
if (style.animationDuration === 'initial' || style.animationDuration === '' || style.animationDuration === '0s') {
elem.style.animationDuration = '1s'
}
if (style.animationFillMode === 'initial' || style.animationFillMode === '' || style.animationFillMode === 'none') {
Expand All @@ -160,7 +160,7 @@ function setAnimationDefaults (elem) {

function setTransitionDefaults (elem) {
const style = elem.style
if (style.transitionDuration === 'initial' || style.transitionDuration === '') {
if (style.transitionDuration === 'initial' || style.transitionDuration === '' || style.transitionDuration === '0s') {
style.transitionDuration = '1s'
}
}
Expand Down

0 comments on commit b3fa9e7

Please sign in to comment.