From ca3cbdc6e5d7d55b5ae1284777e42688af3ff2f0 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 22 Jan 2020 15:34:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Blazor=20=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=A1=A8=E5=A4=B4=E6=98=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E5=8A=A8=E6=80=81=E8=B0=83=E6=95=B4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/wwwroot/css/blazor.css | 2 +- .../Bootstrap.Admin/wwwroot/js/ba.blazor.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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); }); } }