The listen
namespace exposes methods for creating event listeners
(aka handlers) for events related to settings.
- Source:
Methods
(static) not(name, handler)
To stop listening to an event, you can use the not
method.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The event's name |
handler |
function | The callback method that is to no longer be called when the event fires |
- Source:
Example
_converse.api.settings.listen.not('change', callback);
(static) not(name, handler)
To stop listening to an event, you can use the not
method.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The event's name |
handler |
function | The callback method that is to no longer be called when the event fires |
Example
_converse.api.settings.listen.not('change', callback);
(static) on(name, handler, contextopt)
Register an event listener for the passed in event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
'change' | The name of the event to listen for. Currently there is only the 'change' event. |
|
handler |
function | The event handler function |
|
context |
Object |
<optional> |
The context of the |
- Source:
Example
_converse.api.settings.listen.on('change', callback);
(static) on(name, handler, contextopt)
Register an event listener for the passed in event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
'change' | The name of the event to listen for. Currently there is only the 'change' event. |
|
handler |
function | The event handler function |
|
context |
Object |
<optional> |
The context of the |
Example
_converse.api.settings.listen.on('change', callback);