diff --git a/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css b/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css index a91f7526..903523db 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css +++ b/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css @@ -135,7 +135,7 @@ nav .dropdown .nav-link-close.dropdown-toggle:after { } .bootstrap-table .fixed-table-body { - height: 300px; + min-height: 400px; } .bootstrap-table .fixed-table-body table { diff --git a/src/admin/Bootstrap.Admin/wwwroot/js/ba.blazor.js b/src/admin/Bootstrap.Admin/wwwroot/js/ba.blazor.js index abbe4d5d..042ef339 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/js/ba.blazor.js +++ b/src/admin/Bootstrap.Admin/wwwroot/js/ba.blazor.js @@ -152,10 +152,26 @@ $(header).width($(element).width()); }); }, + resetTableHeight(source) { + var table = source; + var height = 0; + do { + height += source.position().top; + source = source.parent(); + if (source.hasClass('tab-content')) break; + } + while (source.length === 1); + height = $(window).height() - height - 15; + table.height(height); + }, initTable: function (id, firstRender) { var $table = $('#' + id); + var $fixedBody = $table.parents('.fixed-table-body'); if (firstRender) { + // calc height + $.resetTableHeight($fixedBody); + // modify scroll $table.parent().overlayScrollbars({ className: 'os-theme-dark', @@ -175,6 +191,7 @@ $(window).on('resize', function () { $.resetTableWidth($table, $tableHeader); + $.resetTableHeight($fixedBody); }); } }