mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 02:04:38 +00:00
Replaced jQuery UI by Animate.css (better, faster, lighter)
This commit is contained in:
@@ -153,3 +153,22 @@ $.fn.isVisibleInViewport = function(extraHeightPadding = 0)
|
||||
|
||||
return elementTop + $(this).outerHeight() > viewportTop && elementTop < viewportTop + $(window).height();
|
||||
};
|
||||
|
||||
function animateCSS(selector, animationName, callback, speed = "faster")
|
||||
{
|
||||
var nodes = $(selector);
|
||||
nodes.addClass('animated').addClass(speed).addClass(animationName);
|
||||
|
||||
function handleAnimationEnd()
|
||||
{
|
||||
nodes.removeClass('animated').removeClass(speed).removeClass(animationName);
|
||||
nodes.unbind('animationend', handleAnimationEnd);
|
||||
|
||||
if (typeof callback === 'function')
|
||||
{
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
nodes.on('animationend', handleAnimationEnd);
|
||||
}
|
||||
|
Reference in New Issue
Block a user