Skip to content

Commit

Permalink
Wait for load of page
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed Apr 15, 2020
1 parent 1c99eb9 commit cf1803e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions public/static/embed-leopard.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ function receiveLeopardMessage(event) {
eval(results[1]);
}
} catch (err) {
console.log(err);
/* ignore as it's most likely another message from another source */
}
}
Expand Down Expand Up @@ -398,9 +399,7 @@ window.addEventListener(
false
);

if (document.readyState === "ready" || document.readyState === "complete") {
var leopardTargetElement = document.getElementById("leopardChatWindow");
if (!leopardTargetElement) {
loadLeopard();
}
}

window.addEventListener('load', function () {
loadLeopard();
});

0 comments on commit cf1803e

Please sign in to comment.