mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
fix fragment issue when no plugin matching
This commit is contained in:
parent
b570189d51
commit
52b6e6f403
1 changed files with 19 additions and 14 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue