Browse Source
Set the first tab active after search in permissions
pull/21210/head
enisn
2 years ago
No known key found for this signature in database
GPG Key ID: A052619F04155D1C
1 changed files with
13 additions and
0 deletions
-
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
|
|
|
|
|
|
|
|
|