浏览代码

Bugfix. Only show a roster group if it has contacts in it.

JC Brand 10 年之前
父节点
当前提交
60eb7552a8
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      converse.js

+ 4 - 4
converse.js

@@ -3826,7 +3826,7 @@
                             }
                         }, this));
                     }
-                    this.showIfInvisible();
+                    this.showIfNecessary();
                 } else {
                     q = q.toLowerCase();
                     matches = this.model.contacts.filter(contains.not('fullname', q));
@@ -3839,13 +3839,13 @@
                         _.each(this.model.contacts.reject(contains.not('fullname', q)), $.proxy(function (item) {
                             this.get(item.get('id')).$el.show();
                         }, this));
-                        this.showIfInvisible();
+                        this.showIfNecessary();
                     }
                 }
             },
 
-            showIfInvisible: function () {
-                if (!this.$el.is(':visible')) {
+            showIfNecessary: function () {
+                if (!this.$el.is(':visible') && this.model.contacts.length > 0) {
                     this.$el.show();
                 }
             },