Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 635a68d

Browse files
SidhNorpkozlowski-opensource
authored andcommitted
Fixed issue #82
1 parent 4629071 commit 635a68d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/collapse/collapse.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ angular.module('ui.bootstrap.collapse',['ui.bootstrap.transition'])
2222

2323
var isCollapsed;
2424

25+
var initialHeightVal = element[0].scrollHeight;
26+
var heightProperlyInitialized = false;
27+
28+
scope.$watch(function (){ return initialHeightVal != element[0].scrollHeight}, function (value) {
29+
//The listener is called when angular bindings are being resolved
30+
//When we have a change of height after binding we are setting again the correct height if the group is opened
31+
if (value && !heightProperlyInitialized) {
32+
heightProperlyInitialized = true;
33+
if (!isCollapsed) {
34+
doTransition({ height : element[0].scrollHeight + 'px' });
35+
}
36+
}
37+
});
38+
2539
scope.$watch(attrs.collapse, function(value) {
2640
if (value) {
2741
collapse();

0 commit comments

Comments
 (0)