Browse Source

Add spaces and use window.history instead of just history

pull/2589/head
Manny Dinssa 2 years ago
parent
commit
ad4c052b66
  1. 6
      app/frontend/controllers/tabs_controller.js

6
app/frontend/controllers/tabs_controller.js

@ -5,14 +5,14 @@ document.addEventListener('DOMContentLoaded', function() {
if (!tab && window.location.hash) {
tab = window.location.hash.substring(1)
urlParams.set('tab', tab)
history.replaceState(null, null, `${window.location.pathname}?${urlParams.toString()}`)
window.history.replaceState(null, null, `${window.location.pathname}?${urlParams.toString()}`)
}
function activateTab (tabId) {
const tabElement = document.getElementById(tabId)
if (tabElement) {
tabElement.click()
}
history.replaceState(null, null, `${window.location.pathname}?${urlParams.toString()}`)
window.history.replaceState(null, null, `${window.location.pathname}?${urlParams.toString()}`)
}
function handleTabClick (event) {
@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', function() {
const targetId = this.getAttribute('href').substring(1)
activateTab(targetId)
urlParams.set('tab', targetId)
history.replaceState(null, null, `${window.location.pathname}?${urlParams.toString()}`)
window.history.replaceState(null, null, `${window.location.pathname}?${urlParams.toString()}`)
}
if (tab) {

Loading…
Cancel
Save