Skip to content

Commit

Permalink
fix: #135
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankit Kumar committed Aug 7, 2022
1 parent 6cccb00 commit 8ba1467
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions static/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,3 +643,14 @@ function onDomContentLoaded() {

// eslint-disable-next-line no-undef
window.addEventListener('DOMContentLoaded', onDomContentLoaded);

console.log('Hash event added');

// eslint-disable-next-line no-undef
window.addEventListener('hashchange', (event) => {
const url = new URL(event.newURL);

if (url.hash !== '') {
bringIdToViewOnMount(url.hash);
}
});
2 changes: 1 addition & 1 deletion static/scripts/core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ba1467

Please sign in to comment.