浏览代码

Simplify by removing need to override `createItemView`

JC Brand 7 年之前
父节点
当前提交
f59048061f
共有 2 个文件被更改,包括 2 次插入14 次删除
  1. 1 0
      CHANGES.md
  2. 1 14
      src/converse-rosterview.js

+ 1 - 0
CHANGES.md

@@ -33,6 +33,7 @@
 - Fetch VCard when starting a chat with someone not in the user's roster.
 - Show status messages in an MUC room when a user's role changes.
 - In MUC chat rooms, collapse multiple, consecutive join/leave messages.
+- Performance improvements for rendering private chats, rooms and the contacts roster.
 
 ### API changes
 - New API method `_converse.disco.supports` to check whether a certain

+ 1 - 14
src/converse-rosterview.js

@@ -676,7 +676,7 @@
 
             _converse.RosterGroupView = Backbone.OrderedListView.extend({
                 tagName: 'div',
-                className: 'roster-group',
+                className: 'roster-group hidden',
                 events: {
                     "click a.group-toggle": "toggle"
                 },
@@ -716,19 +716,6 @@
                     return this;
                 },
 
-                createItemView (contact) {
-                    const contact_view =
-                        Backbone.OrderedListView.prototype.createItemView.apply(this, arguments);
-                    if (contact_view.mayBeShown()) {
-                        if (this.model.get('state') === _converse.CLOSED) {
-                            u.hideElement(contact_view.el);
-                        } else {
-                            u.showElement(contact_view.el);
-                        }
-                        u.showElement(this.el);
-                    }
-                },
-
                 show () {
                     u.showElement(this.el);
                     _.each(this.getAll(), (contact_view) => {