Skip to content

Commit cd0a3f6

Browse files
committed
feat(plugins): Refactor auto-hide functionality to leverage Bootstrap's tab management for improved visibility handling
1 parent 13e9173 commit cd0a3f6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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)