From 81c2ef7b19f9becee94d2656c381013c512f2668 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Tue, 15 Dec 2015 01:22:00 -0500 Subject: [PATCH] fix(collapse): set initial state to avoid animation - Ensure animation does not occur when first loaded --- src/collapse/collapse.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/collapse/collapse.js b/src/collapse/collapse.js index 00d1e31ec0..a24771898d 100644 --- a/src/collapse/collapse.js +++ b/src/collapse/collapse.js @@ -4,7 +4,17 @@ angular.module('ui.bootstrap.collapse', []) var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null; return { link: function(scope, element, attrs) { + if (!scope.$eval(attrs.uibCollapse)) { + element.addClass('in') + .addClass('collapse') + .css({height: 'auto'}); + } + function expand() { + if (element.hasClass('collapse') && element.hasClass('in')) { + return expandDone(); + } + element.removeClass('collapse') .addClass('collapsing') .attr('aria-expanded', true)