Commit 07186bce authored by JC Brand's avatar JC Brand

Performance fix. Set display "none" on the roster element.

parent 015367af
...@@ -1941,6 +1941,8 @@ ...@@ -1941,6 +1941,8 @@
// which appears to be a less economic way. // which appears to be a less economic way.
// i.e. from what it seems, only groups are fetched from // i.e. from what it seems, only groups are fetched from
// browserStorage, and no contacts. // browserStorage, and no contacts.
// XXX: Make sure that if fetch is called, we don't sort on
// each item add...
// converse.roster.fetch() // converse.roster.fetch()
converse.rosterview.render().fetch().update(); converse.rosterview.render().fetch().update();
// TODO: See if we can optimize here by not calling this method // TODO: See if we can optimize here by not calling this method
...@@ -3858,7 +3860,7 @@ ...@@ -3858,7 +3860,7 @@
converse.roster.on("remove", this.update, this); converse.roster.on("remove", this.update, this);
this.model.on("add", this.onGroupAdd, this); this.model.on("add", this.onGroupAdd, this);
this.model.on("reset", this.reset, this); this.model.on("reset", this.reset, this);
this.$roster = $('<dl class="roster-contacts"></dl>'); this.$roster = $('<dl class="roster-contacts" style="display: none;"></dl>');
}, },
update: _.debounce(function () { update: _.debounce(function () {
...@@ -3868,7 +3870,7 @@ ...@@ -3868,7 +3870,7 @@
$count.show(); $count.show();
} }
if (this.$roster.parent().length === 0) { if (this.$roster.parent().length === 0) {
this.$el.append(this.$roster); this.$el.append(this.$roster.show());
} }
console.log('update called'); console.log('update called');
return this.showHideFilter(); return this.showHideFilter();
......
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