adjust samples tables height when in edit mode selecting sample type or group

This commit is contained in:
Mojca Lorber 2017-01-10 16:31:20 +01:00
parent f8237e025a
commit 577e526fec

View file

@ -90,6 +90,7 @@ function dataTableInit() {
animateSpinner(this, false); animateSpinner(this, false);
changeToViewMode(); changeToViewMode();
updateButtons(); updateButtons();
$('div.dataTables_scrollBody').height($('#samples').height());
}, },
preDrawCallback: function() { preDrawCallback: function() {
animateSpinner(this); animateSpinner(this);
@ -440,6 +441,17 @@ function onClickEdit() {
// Adjust columns width in table header // Adjust columns width in table header
table.columns.adjust(); table.columns.adjust();
// Adjust tables height when selecting sample type or group
$('.btn-group.bootstrap-select.show-tick').on('shown.bs.dropdown', function () {
var dropdown_height = $('.dropdown-menu.open').height();
var table_body = $('div.dataTables_scrollBody');
table_body.height(table_body.height()+dropdown_height+6);
})
.on('hidden.bs.dropdown', function(){
$('div.dataTables_scrollBody').height($('#samples').height());
});
$('div.dataTables_scrollBody').height($('#samples').height());
}, },
error: function (e, data, status, xhr) { error: function (e, data, status, xhr) {
if (e.status == 403) { if (e.status == 403) {