Commit 986c1788 authored by JC Brand's avatar JC Brand

Bugfix. 'this' doesn't refer to converse obj.

parent 4877a5ad
......@@ -33,21 +33,21 @@
root.converse = factory(jQuery, _, OTR, DSA, console || {log: function(){}});
}
}(this, function ($, _, OTR, DSA, console) {
var converse = {};
converse.emit = function(evt, data) {
$(this).trigger(evt, data);
};
once = function(evt, handler) {
$(this).one(evt, handler);
};
on = function(evt, handler) {
$(this).bind(evt, handler);
};
off = function(evt, handler) {
$(this).unbind(evt, handler);
var converse = {
emit: function(evt, data) {
$(this).trigger(evt, data);
},
once: function(evt, handler) {
$(this).one(evt, handler);
},
on: function(evt, handler) {
$(this).bind(evt, handler);
},
off: function(evt, handler) {
$(this).unbind(evt, handler);
}
};
converse.initialize = function (settings, callback) {
var converse = this;
......@@ -2678,7 +2678,7 @@
},
rosterHandler: function (items) {
this.emit('onRoster', items);
converse.emit('onRoster', items);
this.cleanCache(items);
_.each(items, function (item, index, items) {
if (this.isSelf(item.jid)) { return; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment