Commit 503dbb94 authored by Moritz Schepp's avatar Moritz Schepp
Browse files

see #293

parent 2ad1a2b1
......@@ -43,16 +43,15 @@
<script type="text/javascript" src="templates/js/search.js"/>
<script>
// keeps bootstrap tab functionality and changes the uri fragment
function toTab(tab) {
const url = AtUrl.current()
url.updateHashParams({'tab': tab})
document.location.hash = url.formatHash()
url.setHashPath(`nav-${tab}`)
url.replaceState()
}
// triggers correct tab loading on page load
window.addEventListener('DOMContentLoaded', event =&gt; {
const tab = AtUrl.current().hashParams()['tab'] || 'transcription'
window.addEventListener('DOMContentLoaded', event => {
const tab = document.location.hash.split('-')[1] || 'transcription'
jQuery(`#nav-${tab}-tab`).tab('show')
jQuery('#nav-tab, #nav-tabContent').show()
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment