mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-06-16 15:10:52 +03:00
Now you can use animateBlock on its own
This commit is contained in:
parent
01ad80aae0
commit
8488ed83c8
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salet",
|
"name": "salet",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"description": "A general client-side framework for cybertext interactive fiction games.",
|
"description": "A general client-side framework for cybertext interactive fiction games.",
|
||||||
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
||||||
"homepage": "http://salet.oreolek.ru",
|
"homepage": "http://salet.oreolek.ru",
|
||||||
|
|
|
@ -244,13 +244,17 @@ class SaletView
|
||||||
|
|
||||||
# A function to play CSS animation on a block.
|
# A function to play CSS animation on a block.
|
||||||
# Implies the effect is one-time, not infinite.
|
# Implies the effect is one-time, not infinite.
|
||||||
# @param block - jQuery object
|
# @param block - jQuery object or selector
|
||||||
# @param effect - animate.css effect to call
|
# @param effect - css effect to call
|
||||||
# @param after - a callback function to execute after the animation is done
|
# @param after - a callback function to execute after the animation is done
|
||||||
@animateBlock = (block, effect, after = undefined) ->
|
@animateBlock = (block, effect, after = undefined) ->
|
||||||
|
block = jQuery(block)
|
||||||
animation = block.css("animation-name") or block.css("-moz-animation-name") or block.css("-webkit-animation-name")
|
animation = block.css("animation-name") or block.css("-moz-animation-name") or block.css("-webkit-animation-name")
|
||||||
if animation
|
if animation
|
||||||
@clearAnimation(block)
|
@clearAnimation(block)
|
||||||
|
if not after?
|
||||||
|
after = (event) ->
|
||||||
|
salet.view.clearAnimation(event.target)
|
||||||
|
|
||||||
block.addClass("animated")
|
block.addClass("animated")
|
||||||
block.addClass(effect)
|
block.addClass(effect)
|
||||||
|
|
Loading…
Reference in a new issue