diff --git a/src/converse-muc-embedded.js b/src/converse-muc-embedded.js index b7368900d..e73613644 100644 --- a/src/converse-muc-embedded.js +++ b/src/converse-muc-embedded.js @@ -39,10 +39,15 @@ ChatRoomView: { insertIntoDOM: function () { - converse.env.jQuery('#converse-embedded-chat').html(this.$el); + if (!document.body.contains(this.el)) { + var container = document.querySelector('#converse-embedded-chat'); + container.innerHTML = ''; + container.appendChild(this.el); + } return this; } } - } + }, + }); }));