diff --git a/demo/index.html b/demo/index.html index 6954957..d74b69f 100644 --- a/demo/index.html +++ b/demo/index.html @@ -9,10 +9,43 @@ +
+ Lazy, initial false +
+
+
+ Some awesome content here +
+
+
- Click to slide in/out + Non lazy, initial false +
+
+
+ Some awesome content here +
+
+ +
+ Lazy, initial true +
+
+
+ Some awesome content here +
+
+ +
+ Non lazy, initial true
-
+
Some awesome content here
@@ -21,4 +54,4 @@ After content
- \ No newline at end of file + diff --git a/demo/ng-slide-down.js b/demo/ng-slide-down.js index c58710f..1b54837 100644 --- a/demo/ng-slide-down.js +++ b/demo/ng-slide-down.js @@ -6,9 +6,9 @@ var getTemplate, link; getTemplate = function (tElement, tAttrs) { if (tAttrs.lazyRender !== void 0) { - return '
'; + return '
'; } else { - return '
'; + return '
'; } }; link = function (scope, element, attrs, ctrl, transclude) { diff --git a/dist/ng-slide-down.js b/dist/ng-slide-down.js index c58710f..1b54837 100644 --- a/dist/ng-slide-down.js +++ b/dist/ng-slide-down.js @@ -6,9 +6,9 @@ var getTemplate, link; getTemplate = function (tElement, tAttrs) { if (tAttrs.lazyRender !== void 0) { - return '
'; + return '
'; } else { - return '
'; + return '
'; } }; link = function (scope, element, attrs, ctrl, transclude) { diff --git a/dist/ng-slide-down.min.js b/dist/ng-slide-down.min.js index e1c76d3..be04146 100644 --- a/dist/ng-slide-down.min.js +++ b/dist/ng-slide-down.min.js @@ -1,2 +1,2 @@ -/*! ng-slide-down 29-04-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?"
":"
"},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({overflow:"hidden",transitionProperty:"height",transitionDuration:""+h+"s",transitionTimingFunction:q,height:k()}),o=a(function(){return c.css({overflow:"visible",transition:"none",height:"auto"})},1e3*h)})},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))})},{restrict:"A",scope:{expanded:"=ngSlideDown"},transclude:!0,link:c,template:function(a,c){return b(a,c)}}}])}).call(this); \ No newline at end of file +/*! ng-slide-down 18-03-2016 */ +(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?"
":"
"},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({overflow:"hidden",transitionProperty:"height",transitionDuration:""+h+"s",transitionTimingFunction:q,height:k()}),o=a(function(){return c.css({overflow:"visible",transition:"none",height:"auto"})},1e3*h)})},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))})},{restrict:"A",scope:{expanded:"=ngSlideDown"},transclude:!0,link:c,template:function(a,c){return b(a,c)}}}])}).call(this); \ No newline at end of file diff --git a/package.json b/package.json index 1611524..b022edb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-slide-down", - "version": "0.4.2", + "version": "1.0.0", "description": "Slider animation directive for AngularJS", "homepage": "https://github.com/TheRusskiy/ng-slide-down", "scripts": { diff --git a/src/ng-slide-down.coffee b/src/ng-slide-down.coffee index 55f9777..3a2f005 100644 --- a/src/ng-slide-down.coffee +++ b/src/ng-slide-down.coffee @@ -2,9 +2,9 @@ angular.module("ng-slide-down", []).directive "ngSlideDown", ($timeout )-> getTemplate = (tElement, tAttrs)-> if tAttrs.lazyRender != undefined - "
" + "
" else - "
" + "
" link = (scope, element, attrs, ctrl, transclude) -> duration = attrs.duration || 1 @@ -79,4 +79,4 @@ angular.module("ng-slide-down", []).directive "ngSlideDown", ($timeout )-> transclude: true link: link template: (tElement, tAttrs)-> getTemplate(tElement, tAttrs) - } \ No newline at end of file + }