Commit f4ff6370 authored by JC Brand's avatar JC Brand

Performance fix. Debounce the update method on the roster.

parent 6088417d
......@@ -3851,14 +3851,14 @@
this.model.on("reset", this.reset, this);
},
update: function () {
update: _.debounce(function () {
var $count = $('#online-count');
$count.text('('+converse.roster.getNumOnlineContacts()+')');
if (!$count.is(':visible')) {
$count.show();
}
return this.showHideFilter();
},
}, 300),
render: function () {
this.$el.html(converse.templates.roster({
......
......@@ -50,7 +50,5 @@
it("contacts in a very large roster change their statuses", $.proxy(function() {
}, converse));
});
}));
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