-
Notifications
You must be signed in to change notification settings - Fork 6
/
velocity.ui.angular.min.js
4 lines (4 loc) · 1.72 KB
/
velocity.ui.angular.min.js
1
2
3
4
/*! velocity-ui-angular - v0.4.0 - 2015-06-17
* https://github.com/rosslavery/velocity-ui-angular
* Copyright (c) 2015 Ross Lavery <[email protected]>; License: MIT */
!function(a){"use strict";function b(a){return".velocity-"+a.replace(".","-")}var c=window.jQuery||window.Zepto||window;if(!c.Velocity||!c.Velocity.Utilities||!c.Velocity.RegisterUI)throw new Error("Velocity UI Pack: Velocity must be loaded first. Aborting.");c.ngVelocity=a.module("velocity.ui",["ngAnimate"]).constant("ngVelocityConfig",{duration:300}).factory("VelocityUtils",["ngVelocityConfig",function(b){return{_parseClassList:function(b){var c={};return a.forEach(b,function(a){a.indexOf("velocity-duration-")>-1&&(c.duration=a.split("velocity-duration-")[1])}),c},_createAngularAnimation:function(a){var b=this,c=a.replace("In","Out");return c.indexOf("Down")>-1?c=c.replace("Down","Up"):c.indexOf("Up")>-1&&(c=c.replace("Up","Down")),{enter:b._createVelocityAnimation(a),leave:b._createVelocityAnimation(c),move:b._createVelocityAnimation(a),beforeAddClass:b._createVelocityClassAnimation(c),removeClass:b._createVelocityClassAnimation(a)}},_createVelocityAnimation:function(d){var e=this;return function(f,g){var h=e._parseClassList(f[0].classList),i=a.extend(b,h);i.display="flex"===f.css("display")?"flex":"auto",i.complete=g,c.Velocity.animate(f,d,i)}},_createVelocityClassAnimation:function(d){var e=this;return function(f,g,h){var i=e._parseClassList(f[0].classList),j=a.extend(b,i);j.display="flex"===f.css("display")?"flex":"auto",j.complete=h,"ng-hide"===g?c.Velocity.animate(f,d,j):h()}}}}]);var d;a.forEach(c.Velocity.RegisterUI.packagedEffects,function(a,e){d=b(e),c.ngVelocity.animation(d,["VelocityUtils",function(a){return a._createAngularAnimation(e)}])})}(angular);