Skip to content

Commit

Permalink
Check first for contentDocument
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed Apr 2, 2020
1 parent c53f6fd commit a66f06d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions public/static/embed-leopard.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,12 @@ function checkLeopardButtonFocus() {
if (teneoFrame && document.activeElement === teneoFrame) {
var teneoContainer = document.getElementById("teneo-chat-widget-container");
if (teneoContainer && teneoContainer.className === "teneo-chat-button-widget") {
var leopardFrameInnerButtonEl = teneoFrame.contentDocument.getElementById('leopard-embed-open-close-button');
if (leopardFrameInnerButtonEl) {
leopardFocusIframe(teneoFrame);
leopardFrameInnerButtonEl.focus();
if (teneoFrame.contentDocument) {
var leopardFrameInnerButtonEl = teneoFrame.contentDocument.getElementById('leopard-embed-open-close-button');
if (leopardFrameInnerButtonEl) {
leopardFocusIframe(teneoFrame);
leopardFrameInnerButtonEl.focus();
}
}
}
}
Expand Down

0 comments on commit a66f06d

Please sign in to comment.