Skip to content

Commit

Permalink
fix: Check DOMContentLoaded was fired before calling waiting for DOMC…
Browse files Browse the repository at this point in the history
…ontentLoaded
  • Loading branch information
kyasbal committed Oct 18, 2017
1 parent cc34443 commit 125e618
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,5 @@ yarn.lock
docs
test-lib
test-lib-es5
package-lock.json
.vscode
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class GrimoireInitializer {
GrimoireInitializer._notifyLibraryLoadingToWindow();
GrimoireInitializer._copyGLConstants();
GrimoireInterface.initialize();
await GrimoireInitializer._waitForDOMLoading();
if (document.readyState === "loading") {
await GrimoireInitializer._waitForDOMLoading();
}
GrimoireInitializer._logVersions();
await GrimoireInterface.resolvePlugins();
await GomlLoader.loadForPage();
Expand Down Expand Up @@ -82,7 +84,7 @@ class GrimoireInitializer {
/**
* Just start the process.
*/
export default function(): typeof GrimoireInterface {
export default function (): typeof GrimoireInterface {
GrimoireInitializer.initialize();
GrimoireInterface.noConflictPreserve = (window as any)["gr"];
return (window as any)["gr"] = (window as any)["GrimoireJS"] = GrimoireInterface;
Expand Down

0 comments on commit 125e618

Please sign in to comment.