Skip to content

Commit

Permalink
set initial demo on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Aug 21, 2024
1 parent f97a57a commit 21f4b28
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
updatePreview(
preview,
doc.getValue(),
video ? video.innerHTML : '',
video ? video.innerHTML : ''
);

refresh.addEventListener('click', update);
Expand Down Expand Up @@ -161,4 +161,15 @@

insertSection('section7');

// on load get #section10 from url hash and set

const hash = window.location.hash.substring(1);

if (hash) {
const section = document.querySelector(`#${hash}`);
if (section) {
insertSection(hash);
}
}

})();

0 comments on commit 21f4b28

Please sign in to comment.