Performance fix. Debounce the update method on the roster.

This commit is contained in:
JC Brand 2014-10-25 09:57:05 +02:00
parent 6088417df7
commit f4ff6370b9
2 changed files with 2 additions and 4 deletions

View File

@ -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({

View File

@ -50,7 +50,5 @@
it("contacts in a very large roster change their statuses", $.proxy(function() {
}, converse));
});
}));