From 4c2392568405649be1370669075e3ee0572e4880 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Fri, 28 Apr 2017 19:49:36 +0200 Subject: [PATCH] Fixes #861: Properly insert chatroom into DOM --- src/converse-muc-embedded.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } } - } + }, + }); }));