mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 21:34:28 +02:00
collapsibleContainer.js: Properly set an collapsible's height
This commit is contained in:
parent
fb83bee924
commit
1032a944b4
@ -75,7 +75,7 @@
|
|||||||
if (this.expandedContainers[collapsiblePath]) {
|
if (this.expandedContainers[collapsiblePath]) {
|
||||||
this.expandedContainers[collapsiblePath] = false;
|
this.expandedContainers[collapsiblePath] = false;
|
||||||
$collapsible.removeClass('collapsed');
|
$collapsible.removeClass('collapsed');
|
||||||
$collapsible.css({ maxHeight: 'none' });
|
$collapsible.css({display: '', height: ''});
|
||||||
} else {
|
} else {
|
||||||
this.expandedContainers[collapsiblePath] = true;
|
this.expandedContainers[collapsiblePath] = true;
|
||||||
$collapsible.addClass('collapsed');
|
$collapsible.addClass('collapsed');
|
||||||
@ -84,14 +84,14 @@
|
|||||||
if (!! rowSelector) {
|
if (!! rowSelector) {
|
||||||
var $rows = $(rowSelector, $collapsible).slice(0, $collapsible.data('numofrows') || this.defaultNumOfRows);
|
var $rows = $(rowSelector, $collapsible).slice(0, $collapsible.data('numofrows') || this.defaultNumOfRows);
|
||||||
|
|
||||||
var totalHeight = 0;
|
var totalHeight = $rows.offset().top - $collapsible.offset().top;
|
||||||
$rows.outerHeight(function (_, height) {
|
$rows.outerHeight(function (_, height) {
|
||||||
totalHeight += height;
|
totalHeight += height;
|
||||||
});
|
});
|
||||||
|
|
||||||
$collapsible.css({maxHeight: totalHeight});
|
$collapsible.css({display: 'block', height: totalHeight});
|
||||||
} else {
|
} else {
|
||||||
$collapsible.css({maxHeight: $collapsible.data('height') || this.defaultHeight});
|
$collapsible.css({display: 'block', height: $collapsible.data('height') || this.defaultHeight});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user