Performance fix. Debounce the update method on the roster.
This commit is contained in:
parent
6088417df7
commit
f4ff6370b9
@ -3851,14 +3851,14 @@
|
|||||||
this.model.on("reset", this.reset, this);
|
this.model.on("reset", this.reset, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function () {
|
update: _.debounce(function () {
|
||||||
var $count = $('#online-count');
|
var $count = $('#online-count');
|
||||||
$count.text('('+converse.roster.getNumOnlineContacts()+')');
|
$count.text('('+converse.roster.getNumOnlineContacts()+')');
|
||||||
if (!$count.is(':visible')) {
|
if (!$count.is(':visible')) {
|
||||||
$count.show();
|
$count.show();
|
||||||
}
|
}
|
||||||
return this.showHideFilter();
|
return this.showHideFilter();
|
||||||
},
|
}, 300),
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
this.$el.html(converse.templates.roster({
|
this.$el.html(converse.templates.roster({
|
||||||
|
@ -50,7 +50,5 @@
|
|||||||
|
|
||||||
it("contacts in a very large roster change their statuses", $.proxy(function() {
|
it("contacts in a very large roster change their statuses", $.proxy(function() {
|
||||||
}, converse));
|
}, converse));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user