Debounce so that it doesn't get called for each fetched contact
This commit is contained in:
parent
d0c13ea91c
commit
f4c1e0916e
@ -700,13 +700,13 @@
|
|||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateOnlineCount: function () {
|
updateOnlineCount: _.debounce(function () {
|
||||||
var $count = this.$('#online-count');
|
var $count = this.$('#online-count');
|
||||||
$count.text('('+converse.roster.getNumOnlineContacts()+')');
|
$count.text('('+converse.roster.getNumOnlineContacts()+')');
|
||||||
if (!$count.is(':visible')) {
|
if (!$count.is(':visible')) {
|
||||||
$count.show();
|
$count.show();
|
||||||
}
|
}
|
||||||
},
|
}, converse.animate ? 100 : 0),
|
||||||
|
|
||||||
hide: function (callback) {
|
hide: function (callback) {
|
||||||
this.$el.fadeOut('fast', callback);
|
this.$el.fadeOut('fast', callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user