Skip to content

Commit

Permalink
Merge with importmap tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kawakamimoeki committed Oct 17, 2024
1 parent 7e065fa commit 3ffed77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/clapton/javascripts/dist/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,13 @@ document.addEventListener("DOMContentLoaded", async () => {
const event = new Event('clapton:render');
document.dispatchEvent(event);
});
document.addEventListener("turbo:render", async () => {
await initializeComponents();
initializeActions();
initializeInputs();
const event = new Event('clapton:render');
document.dispatchEvent(event);
});
window.addEventListener('beforeunload', () => {
sessionStorage.setItem('scrollPosition', window.scrollY.toString());
});
Expand Down
8 changes: 8 additions & 0 deletions lib/clapton/javascripts/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ document.addEventListener("DOMContentLoaded", async () => {
document.dispatchEvent(event);
});

document.addEventListener("turbo:render", async () => {
await initializeComponents();
initializeActions();
initializeInputs();
const event = new Event('clapton:render');
document.dispatchEvent(event);
});

window.addEventListener('beforeunload', () => {
sessionStorage.setItem('scrollPosition', window.scrollY.toString());
});
Expand Down

0 comments on commit 3ffed77

Please sign in to comment.