Merge pull request #1579 from netalertx/next_release

feat(plugins): Refactor auto-hide functionality to leverage Bootstrap…
This commit is contained in:
Jokob @NetAlertX
2026-03-27 21:16:38 +11:00
committed by GitHub

View File

@@ -484,13 +484,10 @@ function autoHideEmptyTabs(counts, prefixes) {
if ($activeLi.length === 0) { if ($activeLi.length === 0) {
const $firstVisibleLi = $(`#tabs-location li:visible`).first(); const $firstVisibleLi = $(`#tabs-location li:visible`).first();
if ($firstVisibleLi.length) { if ($firstVisibleLi.length) {
$firstVisibleLi.addClass('active'); // Let Bootstrap's .tab('show') manage the active class on both
const targetPrefix = $firstVisibleLi.find('a').attr('href')?.replace('#', ''); // the <li> and the pane — adding it manually beforehand causes
if (targetPrefix) { // Bootstrap to bail out early without firing shown.bs.tab.
$(`#tabs-content-location > #${targetPrefix}`).addClass('active'); $firstVisibleLi.find('a').tab('show');
// Trigger shown.bs.tab so deferred DataTables initialize
$firstVisibleLi.find('a').tab('show');
}
} }
} }
} }