fix: add manualSpacingOffset to fillAvailableHeight VMs & Dockers for improved layout

- Introduced manualSpacingOffset parameter in DockerContainers.page and VMMachines.page to prevent unwanted scrollable space in the main content.
- Updated fillAvailableHeight calls to include this parameter, enhancing the overall layout consistency across pages.
This commit is contained in:
Zack Spear
2025-06-27 12:43:41 -07:00
parent 445deceb09
commit fefc4c5bba
2 changed files with 25 additions and 19 deletions

View File

@@ -177,6 +177,7 @@ function loadlist(init) {
'.js-actions',
'#docker_containers thead',
],
manualSpacingOffset: 30, // without this, the main content will still be scrollable by like 20px
});
resizeTableColumns()
if (init) {

View File

@@ -437,25 +437,6 @@ function loadlist() {
var data = d.split(/\0/);
$('#kvm_list').html(data[0]);
$('head').append('<script>'+data[1]+'<\/script>');
<?if (_var($display,'resize')):?>
fillAvailableHeight({
targetElementSelector: '.js-fill-available-height',
elementSelectorsForHeight: [
'.js-actions',
],
});
// Handle table header fixed positioning after resize
function tableHeaderResize() {
$('#kvm_table thead,#kvm_table tbody').removeClass('fixed');
$('#kvm_table thead tr th').each(function(){$(this).width($(this).width());});
$('#kvm_table tbody tr td').each(function(){$(this).width($(this).width());});
$('#kvm_table thead,#kvm_table tbody').not('.child').addClass('fixed');
}
tableHeaderResize();
$(window).bind('resize',function(){
tableHeaderResize();
});
<?endif;?>
<?foreach ($vms as $vm) {
$res = $lv->get_domain_by_name($vm);
$uuid = $lv->domain_get_uuid($res);
@@ -480,6 +461,30 @@ function loadlist() {
$('input[type=button]').prop('disabled',false).show('slow');
$('.text').click(showInput);
$('.input').blur(hideInput);
<?if (_var($display,'resize')):?>
fillAvailableHeight({
targetElementSelector: '.js-fill-available-height',
elementSelectorsForHeight: [
'.js-actions',
'#kvm_table thead',
],
elementSelectorsForSpacing: [
'#kvm_table',
],
manualSpacingOffset: 30, // without this, the main content will still be scrollable by like 20px
});
// Handle table header fixed positioning after resize
function tableHeaderResize() {
$('#kvm_table thead,#kvm_table tbody').removeClass('fixed');
$('#kvm_table thead tr th').each(function(){$(this).width($(this).width());});
$('#kvm_table tbody tr td').each(function(){$(this).width($(this).width());});
$('#kvm_table thead,#kvm_table tbody').not('.child').addClass('fixed');
}
tableHeaderResize();
$(window).bind('resize',function(){
tableHeaderResize();
});
<?endif;?>
});
}
$(function() {