소스 검색

Shadow dom: TypeError: Cannot read property 'parentElement' of null caused by MinimizedChatsToggleView

Réda Housni Alaoui 6 년 전
부모
커밋
c2db667321
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      CHANGES.md
  2. 3 1
      src/converse-minimize.js

+ 1 - 0
CHANGES.md

@@ -57,6 +57,7 @@
 - #1579: Trim spaces at the beginning and end of a JID (when adding contact)
 - #1585: Upload files by pasting from clipboard
 - #1586: Not possible to kick someone with a space in their nickname
+- Bugfix: "Cannot read property 'parentElement' of null" in shadow dom
 
 ### Breaking changes
 

+ 3 - 1
src/converse-minimize.js

@@ -530,7 +530,9 @@ converse.plugins.add('converse-minimize', {
 
 
         _converse.MinimizedChatsToggleView = Backbone.NativeView.extend({
-            el: '#toggle-minimized-chats',
+            _setElement (){
+                this.el = _converse.root.querySelector('#toggle-minimized-chats');
+            },
 
             initialize () {
                 this.model.on('change:num_minimized', this.render, this);