mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
use browser history api to avoid page jumps on hash change
This commit is contained in:
parent
ccfc05d200
commit
53adf2b3b7
1 changed files with 1 additions and 1 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
options[i].getElementsByTagName("summary")[0].onclick = function() {
|
options[i].getElementsByTagName("summary")[0].onclick = function() {
|
||||||
|
|
||||||
// set URL fragment to option id
|
// set URL fragment to option id
|
||||||
window.location.hash = this.parentElement.id;
|
history.pushState({}, "", `#${this.parentElement.id}`);
|
||||||
|
|
||||||
// is current panel open, return immediately as it's just being closed
|
// is current panel open, return immediately as it's just being closed
|
||||||
if (this.parentElement.hasAttribute("open")) return;
|
if (this.parentElement.hasAttribute("open")) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue