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

This commit is contained in:
JC Brand 2013-12-16 14:37:30 +02:00
parent 4877a5adb6
commit 986c17884b

View File

@ -33,21 +33,21 @@
root.converse = factory(jQuery, _, OTR, DSA, console || {log: function(){}});
}
}(this, function ($, _, OTR, DSA, console) {
var converse = {};
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.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; }