Fix intro after beacon upgrade

[MAILPOET-2351]
This commit is contained in:
Pavel Dohnal
2019-09-10 09:30:57 +02:00
committed by Jack Kitterhing
parent 6584d84dbb
commit 7e112cbbfc

View File

@ -395,10 +395,18 @@
<% block after_javascript %> <% block after_javascript %>
<% if settings.show_intro %> <% if settings.show_intro %>
<script> <script>
HS.beacon.ready(function () { const initIntro = () => {
document.querySelector('#hs-beacon iframe').classList.add('mailpoet-chat'); const beacon = document.querySelector('#beacon-container iframe');
if (beacon) {
beacon.classList.add('mailpoet-chat');
MailPoet.showIntro(); MailPoet.showIntro();
}); } else {
setTimeout(initIntro, 200);
}
};
document.addEventListener('DOMContentLoaded', function(){
initIntro();
}, false);
</script> </script>
<% endif %> <% endif %>
<% endblock %> <% endblock %>