mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-30 23:03:03 -07:00
Merge pull request #1579 from netalertx/next_release
feat(plugins): Refactor auto-hide functionality to leverage Bootstrap…
This commit is contained in:
@@ -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');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user