Skip to content

Commit

Permalink
toh.js: don't defer initialization
Browse files Browse the repository at this point in the history
We might get sourced when the DOM is already loaded.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Nov 30, 2023
1 parent 792385a commit 660907d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions toh.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ function initToH(full) {
});
}

document.addEventListener('DOMContentLoaded', function() {
if (document.querySelector('div.wrap_toh'))
initToH(false);
if (document.querySelector('div.wrap_toh'))
initToH(false);

if (document.querySelector('div.wrap_toh_full'))
initToH(true);
});
if (document.querySelector('div.wrap_toh_full'))
initToH(true);

0 comments on commit 660907d

Please sign in to comment.