fix fragment issue when no plugin matching

This commit is contained in:
Jordan Blasenhauer 2024-04-15 11:46:06 +02:00
parent b570189d51
commit 52b6e6f403

View file

@ -140,22 +140,27 @@ class TabsSelect {
});
// If fragment exists, click on the corresponding tab
if (
window.location.hash &&
window.location.pathname.endsWith("global_config")
) {
const fragment = window.location.hash.substring(1);
if (fragment) {
const tab = this.tabContainer.querySelector(
`button[data-tab-select-handler='${fragment}']`,
);
tab.click();
// Scroll to the top of the page (with a delay to ensure the tab is clicked first)
setTimeout(() => {
window.scrollTo(0, 0);
}, 100);
try {
if (
window.location.hash &&
window.location.pathname.endsWith("global_config")
) {
const fragment = window.location.hash.substring(1);
if (fragment) {
const tab = this.tabContainer.querySelector(
`button[data-tab-select-handler='${fragment}']`,
);
tab.click();
// Scroll to the top of the page (with a delay to ensure the tab is clicked first)
setTimeout(() => {
window.scrollTo(0, 0);
}, 100);
}
}
}catch(e) {
}
}
resetTabsStyle() {