Selaa lähdekoodia

MUC: missing toggle Call handler and function

the Call button is visible but no action is done
thierrytiti 10 vuotta sitten
vanhempi
commit
7366bb709d
3 muutettua tiedostoa jossa 13 lisäystä ja 2 poistoa
  1. 10 1
      converse.js
  2. 2 0
      docs/CHANGES.rst
  3. 1 1
      docs/source/configuration.rst

+ 10 - 1
converse.js

@@ -2358,6 +2358,7 @@
                 'click .toggle-smiley': 'toggleEmoticonMenu',
                 'click .toggle-smiley ul li': 'insertEmoticon',
                 'click .toggle-clear': 'clearChatRoomMessages',
+                'click .toggle-call': 'toggleCall',
                 'click .toggle-participants a': 'toggleOccupants',
                 'keypress textarea.chat-textarea': 'keyPressed',
                 'mousedown .dragresize-tm': 'onDragResizeStart'
@@ -2427,7 +2428,15 @@
                 this.toggleOccupants();
                 return this;
             },
-
+			
+            toggleCall: function (ev) {
+                ev.stopPropagation();
+                converse.emit('callButtonClicked', {
+                    connection: converse.connection,
+                    model: this.model
+                });
+            },
+			
             toggleOccupants: function (ev) {
                 if (ev) {
                     ev.preventDefault();

+ 2 - 0
docs/CHANGES.rst

@@ -15,6 +15,8 @@ Changelog
 * CSS fix: room-info bug on hover after room description loaded [thierrytiti]
 * I18N: Autodetection of User Locale if no i18n setting is set. [thierrytiti]
 * CSS: Fonts Path: editabable $font-path via sass/variables.scss [thierrytiti]
+* MUC: missing toggle Call handler and function [thierrytiti]
+* Updated documentation about call [thierrytiti]
 
 0.9.3 (2015-05-01)
 ------------------

+ 1 - 1
docs/source/configuration.rst

@@ -528,7 +528,7 @@ Allows you to show or hide buttons on the chat boxes' toolbars.
     Provides a button with a picture of a telephone on it.
     When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.::
 
-        converse.on('callButtonClicked', function(event, data) {
+        converse.listen.on('callButtonClicked', function(event, data) {
             console.log('Strophe connection is', data.connection);
             console.log('Bare buddy JID is', data.model.get('jid'));
             // ... Third-party library code ...