Commit b8107afa authored by JC Brand's avatar JC Brand

Bugfix. Remove highlight from roster item when chatbox is closed.

parent f0201e23
......@@ -59683,12 +59683,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].plugins
if (_converse.isUniView()) {
const chatbox = _converse.chatboxes.get(this.model.get('jid'));
if (chatbox) {
if (chatbox.get('hidden')) {
this.el.classList.remove('open');
} else {
this.el.classList.add('open');
}
if (chatbox && chatbox.get('hidden') || !chatbox) {
this.el.classList.remove('open');
} else {
this.el.classList.add('open');
}
}
},
......@@ -60278,15 +60276,19 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].plugins
/* -------- Event Handlers ----------- */
_converse.api.listen.on('chatBoxesInitialized', () => {
_converse.chatboxes.on('change:hidden', chatbox => {
function highlightRosterItem(chatbox) {
const contact = _converse.roster.findWhere({
'jid': chatbox.get('jid')
});
if (!_.isUndefined(contact)) {
contact.trigger('highlight', contact);
contact.trigger('highlight');
}
});
}
_converse.chatboxes.on('destroy', chatbox => highlightRosterItem(chatbox));
_converse.chatboxes.on('change:hidden', chatbox => highlightRosterItem(chatbox));
});
function initRoster() {
......@@ -485,12 +485,10 @@ converse.plugins.add('converse-rosterview', {
*/
if (_converse.isUniView()) {
const chatbox = _converse.chatboxes.get(this.model.get('jid'));
if (chatbox) {
if (chatbox.get('hidden')) {
this.el.classList.remove('open');
} else {
this.el.classList.add('open');
}
if ((chatbox && chatbox.get('hidden')) || !chatbox) {
this.el.classList.remove('open');
} else {
this.el.classList.add('open');
}
}
},
......@@ -1009,16 +1007,16 @@ converse.plugins.add('converse-rosterview', {
}
});
/* -------- Event Handlers ----------- */
_converse.api.listen.on('chatBoxesInitialized', () => {
_converse.chatboxes.on('change:hidden', (chatbox) => {
function highlightRosterItem (chatbox) {
const contact = _converse.roster.findWhere({'jid': chatbox.get('jid')});
if (!_.isUndefined(contact)) {
contact.trigger('highlight', contact);
contact.trigger('highlight');
}
});
}
_converse.chatboxes.on('destroy', chatbox => highlightRosterItem(chatbox));
_converse.chatboxes.on('change:hidden', chatbox => highlightRosterItem(chatbox));
});
function initRoster () {
......
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