-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathng-slide-down.min.js
2 lines (2 loc) · 1.38 KB
/
ng-slide-down.min.js
1
2
/*! ng-slide-down 26-11-2015 */
(function(){"use strict";angular.module("ng-slide-down",[]).directive("ngSlideDown",["$timeout",function(a){var b,c;return b=function(a,b){return void 0!==b.lazyRender?"<div ng-if='lazyRender' ng-transclude></div>":"<div ng-transclude></div>"},c=function(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;return h=d.duration||1,q=d.timingFunction||"ease-in-out",i=c.scope(),j=d.emitOnClose,n=d.onClose,m=void 0!==d.lazyRender,g=null,o=null,k=function(a){var b,d,e,f,g;for(e=0,d=c.children(),f=0,g=d.length;g>f;f++)b=d[f],e+=b.clientHeight;return""+e+"px"},p=function(){return g&&a.cancel(g),m&&(b.lazyRender=!0),a(function(){return o&&a.cancel(o),c.css({height:k()}),a(function(){return c.css({overflow:"hidden",transitionProperty:"height",transitionDuration:""+h+"s",transitionTimingFunction:q}),o=a(function(){return c.css({overflow:"visible",transition:"none",height:"auto"})},1e3*h,!1)},0,!1)},0,!1)},l=function(){return o&&a.cancel(o),c.css({overflow:"hidden",transitionProperty:"height",transitionDuration:""+h+"s",transitionTimingFunction:q,height:"0px"}),j||n||m?g=a(function(){return j&&b.$emit(j,{}),n&&i.$eval(n),m?b.lazyRender=!1:void 0},1e3*h):void 0},b.$watch("expanded",function(b,d){return b?a(p):(null!=b&&(c.css({height:k()}),c[0].clientHeight),a(l,0,!1))})},{restrict:"A",scope:{expanded:"=ngSlideDown"},transclude:!0,link:c,template:function(a,c){return b(a,c)}}}])}).call(this);