Skip to content

Commit 49b72ac

Browse files
authored
Merge pull request #1579 from netalertx/next_release
feat(plugins): Refactor auto-hide functionality to leverage Bootstrap…
2 parents adc78e6 + cd0a3f6 commit 49b72ac

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

front/pluginsCore.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,10 @@ function autoHideEmptyTabs(counts, prefixes) {
484484
if ($activeLi.length === 0) {
485485
const $firstVisibleLi = $(`#tabs-location li:visible`).first();
486486
if ($firstVisibleLi.length) {
487-
$firstVisibleLi.addClass('active');
488-
const targetPrefix = $firstVisibleLi.find('a').attr('href')?.replace('#', '');
489-
if (targetPrefix) {
490-
$(`#tabs-content-location > #${targetPrefix}`).addClass('active');
491-
// Trigger shown.bs.tab so deferred DataTables initialize
492-
$firstVisibleLi.find('a').tab('show');
493-
}
487+
// Let Bootstrap's .tab('show') manage the active class on both
488+
// the <li> and the pane — adding it manually beforehand causes
489+
// Bootstrap to bail out early without firing shown.bs.tab.
490+
$firstVisibleLi.find('a').tab('show');
494491
}
495492
}
496493
}

0 commit comments

Comments
 (0)