js: fix anchor on tab selection (#68711)
gitea/gadjo/pipeline/head Build started... Details

This commit is contained in:
Lauréline Guérin 2022-09-09 09:59:53 +02:00
parent ad04de1273
commit b297690b3f
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 2 additions and 1 deletions

View File

@ -344,7 +344,8 @@ var gadjo_js = gadjo_js || {};
// Adjust URL to mention selected tab
const url = new URL(document.location);
url.hash = '#open:' + btn.getAttribute('aria-controls').substring(6);
const prefix = btn.getAttribute('aria-controls').split('-')[0];
url.hash = '#open:' + btn.getAttribute('aria-controls').substring(prefix.length + 1);
history.replaceState(null, '', url);
// Trigger gadjo:tab-selected event on panel