Explorar o código

Two changes, see below:

* Call refreshWebkit hack when opening a chat room
* New event emitted when a chat room is opened.
JC Brand %!s(int64=11) %!d(string=hai) anos
pai
achega
53f38dcc71
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  1. 4 0
      converse.js
  2. 2 0
      docs/source/index.rst

+ 4 - 0
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;
             },
 

+ 2 - 0
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) { ... });``                          |