Commit eb67f103 authored by JC Brand's avatar JC Brand

Handle case where there isn't a MUC close button

parent e9872145
......@@ -67,8 +67,14 @@ converse.plugins.add('converse-bookmarks', {
__('Bookmark this groupchat'),
'bookmarked': this.model.get('bookmarked')
}));
const close_button = this.el.querySelector('.close-chatbox-button');
const buttons_row = this.el.querySelector('.chatbox-buttons')
const close_button = buttons_row.querySelector('.close-chatbox-button');
if (close_button) {
close_button.insertAdjacentHTML('afterend', bookmark_button);
} else {
buttons_row.insertAdjacentHTML('beforeEnd', bookmark_button);
}
},
async renderHeading () {
......
......@@ -207,12 +207,14 @@ converse.plugins.add('converse-minimize', {
const html = this.__super__.generateHeadingHTML.apply(this, arguments);
const div = document.createElement('div');
div.innerHTML = html;
const button = div.querySelector('.close-chatbox-button');
button.insertAdjacentHTML('afterend',
tpl_chatbox_minimize({
'info_minimize': __('Minimize this chat box')
})
);
const buttons_row = div.querySelector('.chatbox-buttons')
const button = buttons_row.querySelector('.close-chatbox-button');
const minimize_el = tpl_chatbox_minimize({'info_minimize': __('Minimize this chat box')})
if (button) {
button.insertAdjacentHTML('afterend', minimize_el);
} else {
buttons_row.insertAdjacentHTML('beforeEnd', minimize_el);
}
return div.innerHTML;
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment