Skip to content

Commit

Permalink
embed issues with document load in IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed Apr 15, 2020
1 parent 7332cc8 commit fa2fec8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions public/static/embed-leopard.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,17 @@ window.addEventListener(
false
);

function addListener(event, obj, fn) {
if (obj.addEventListener) {
obj.addEventListener(event, fn, false); // modern browsers
} else {
obj.attachEvent("on"+event, fn); // older versions of IE
}
}

window.addEventListener('load', function () {
loadLeopard();
addListener('load', window, function (event) {
var leopardTargetElement = document.getElementById("leopardChatWindow");
if (!leopardTargetElement) {
loadLeopard();
}
});

0 comments on commit fa2fec8

Please sign in to comment.