Skip to content

Commit 033549c

Browse files
Set up immediately if document is already loaded
1 parent f4d4067 commit 033549c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

code-input.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,12 @@ var codeInput = {
831831
if (this.templateObject != undefined) {
832832
// Template registered before loading
833833
this.classList.add("code-input_registered");
834-
// Children not yet present - wait until they are
835-
window.addEventListener("DOMContentLoaded", this.setup.bind(this))
834+
if (document.readyState === 'loading') {
835+
// Children not yet present - wait until they are
836+
window.addEventListener("DOMContentLoaded", this.setup.bind(this))
837+
} else {
838+
this.setup();
839+
}
836840
}
837841
}
838842

0 commit comments

Comments
 (0)