From c1e30b1aab84697e3e11adac43649d623939cf79 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 30 Oct 2024 11:33:41 +0300 Subject: [PATCH 1/2] Set the first tab active after search in permissions --- .../permission-management-modal.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index 3723eda9327..2f4340a8fbe 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -291,6 +291,7 @@ var abp = abp || {}; $permissionSearchInput.keyup(throttle(function() { var searchTerm = $permissionSearchInput.val().toLowerCase(); filterTabs(searchTerm); + setFirstVisibleTabActive(); }, 300)); function filterTabs(searchTerm) { @@ -324,6 +325,18 @@ var abp = abp || {}; }); } + function setFirstVisibleTabActive() { + $('#PermissionsTabsContent .tab-pane').removeClass('active show'); + + var $tabs = $('#PermissionsTabs .nav-link'); + var $firstVisibleTab = $tabs.filter(':visible').first(); + $tabs.removeClass('active'); + $firstVisibleTab.addClass('active'); + + var $firstVisibleTabContent = $($firstVisibleTab.attr('href')); + $firstVisibleTabContent.addClass('active show'); + } + function throttle(mainFunction, delay) { let timerFlag = null; // Variable to keep track of the timer From 8da56d68b928910f5ee6bd6c115bae756709e7a5 Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 7 Nov 2024 12:41:05 +0300 Subject: [PATCH 2/2] Update permission-management-modal.js --- .../AbpPermissionManagement/permission-management-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index 2f4340a8fbe..9f97800cbc3 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -305,7 +305,7 @@ var abp = abp || {}; return; } - var tabName = $tabItem.find('small').text().toLowerCase(); + var tabName = $tabItem.text().toLowerCase(); var tabContentFilters = $($tabItem.attr('href')).find('[data-filter-text]'); let includedInTabContent = false;