From 53f38dcc719b7043d503a0c5648ceffd8f392a7d Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 17 Jul 2014 19:18:13 +0200 Subject: [PATCH] Two changes, see below: * Call refreshWebkit hack when opening a chat room * New event emitted when a chat room is opened. --- converse.js | 4 ++++ docs/source/index.rst | 2 ++ 2 files changed, 6 insertions(+) diff --git a/converse.js b/converse.js index 990f9dcfe..7d65488bb 100644 --- a/converse.js +++ b/converse.js @@ -1934,6 +1934,10 @@ render: function () { this.$el.attr('id', this.model.get('box_id')) .html(converse.templates.chatroom(this.model.toJSON())); + converse.emit('chatRoomOpened', this); + setTimeout(function () { + converse.refreshWebkit(); + }, 50); return this; }, diff --git a/docs/source/index.rst b/docs/source/index.rst index 7cd6e27c9..5e0a0dcc4 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -783,6 +783,8 @@ Here are the different events that are emitted: +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ | **chatBoxOpened** | When a chat box has been opened. | ``converse.on('chatBoxOpened', function (chatbox) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ +| **chatRoomOpened** | When a chat room has been opened. | ``converse.on('chatRoomOpened', function (chatbox) { ... });`` | ++----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ | **chatBoxClosed** | When a chat box has been closed. | ``converse.on('chatBoxClosed', function (chatbox) { ... });`` | +----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ | **chatBoxFocused** | When the focus has been moved to a chat box. | ``converse.on('chatBoxFocused', function (chatbox) { ... });`` |