Skip to content

Commit

Permalink
Fix callback check for fadeIn / fadeOut effects
Browse files Browse the repository at this point in the history
  • Loading branch information
klausborges authored May 14, 2024
1 parent 2956944 commit 8d240ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions surreal.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function pluginEffects(e) {
await tick()
surreal.styles(e, {transform: 'scale(0.9)', opacity: '0'})
await sleep(ms, e)
if (fn === 'function') fn(thing) // Run custom callback?
if (typeof fn === 'function') fn(thing) // Run custom callback?
if (remove) surreal.remove(thing) // Remove element after animation is completed?
})()
}
Expand All @@ -271,7 +271,7 @@ function pluginEffects(e) {
await sleep(ms, e)
e.style = save // Revert back to original style.
surreal.styles(e, {opacity: '1'}) // Ensure we're visible after reverting to original style.
if (fn === 'function') fn(thing) // Run custom callback?
if (typeof fn === 'function') fn(thing) // Run custom callback?
})()
}
}
Expand Down

0 comments on commit 8d240ba

Please sign in to comment.