Explorar o código

Fixes #861: Properly insert chatroom into DOM

JC Brand %!s(int64=8) %!d(string=hai) anos
pai
achega
4c23925684
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      src/converse-muc-embedded.js

+ 7 - 2
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;
                 }
             }
-        }
+        },
+
     });
 }));