Handle case where there isn't a MUC close button
This commit is contained in:
parent
e987214555
commit
eb67f10371
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user