New event: chatBoxBlurred

This commit is contained in:
JC Brand 2019-05-14 16:26:25 +02:00
parent 86f3399dc0
commit 12989ab241
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,7 @@
- Replace `moment` with [DayJS](https://github.com/iamkun/dayjs).
- New API method [\_converse.api.disco.features.get](https://conversejs.org/docs/html/api/-_converse.api.disco.features.html#.get)
- New config setting [muc_show_disconnection_status](https://conversejs.org/docs/html/configuration.html#muc-show-disconnection-status)
- New event: `chatBoxBlurred`.
- #1296: `embedded` view mode shows `chatbox-navback` arrow in header
- #1465: When highlighting a roster contact, they're incorrectly shown as online
- #1532: Converse reloads on enter pressed in the filter box

View File

@ -415,6 +415,15 @@ converse.plugins.add('converse-chatview', {
}));
const textarea_el = this.el.querySelector('.chat-textarea');
textarea_el.addEventListener('focus', () => this.emitFocused());
textarea_el.addEventListener('blur', () => {
/**
* Triggered when the focus has been removed from a particular chat.
* @event _converse#chatBoxBlurred
* @type { _converse.ChatBoxView | _converse.ChatRoomView }
* @example _converse.api.listen.on('chatBoxBlurred', view => { ... });
*/
_converse.api.trigger('chatBoxBlurred', this);
});
this.renderToolbar();
},