diff --git a/templates/slot/slot.html b/templates/slot/slot.html index 8360d5101..a04364b89 100644 --- a/templates/slot/slot.html +++ b/templates/slot/slot.html @@ -3,13 +3,13 @@

{{- if not (eq .Slot 0) -}} - + {{- else -}} {{- end -}} Slot {{ .Slot }} {{- if gt .NextSlot 0 -}} - + {{- else -}} {{- end -}} @@ -455,8 +455,20 @@

Tracoor Traces
if (target.length) target.tab('show'); } + function syncSlotNavHashes() { + var hash = window.location.hash || ''; + $('.slot-nav-link').each(function() { + var base = this.getAttribute('data-slot-nav-base') || this.getAttribute('href'); + this.setAttribute('href', base + hash); + }); + } + activateTabByHash(); - window.addEventListener('hashchange', activateTabByHash); + syncSlotNavHashes(); + window.addEventListener('hashchange', function() { + activateTabByHash(); + syncSlotNavHashes(); + }); $('.nav-tabs a[data-bs-toggle="tab"]').on('shown.bs.tab', function(e) { var href = e.target.getAttribute('href') || ''; @@ -464,6 +476,7 @@
Tracoor Traces
var newHash = href === '#overview' ? '' : href; if (window.location.hash !== newHash) { window.history.replaceState(null, document.title, window.location.pathname + window.location.search + newHash); + syncSlotNavHashes(); } });