2
0
Эх сурвалжийг харах

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

JC Brand 10 жил өмнө
parent
commit
60eb7552a8
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 4
      converse.js

+ 4 - 4
converse.js

@@ -3826,7 +3826,7 @@
                             }
                             }
                         }, this));
                         }, this));
                     }
                     }
-                    this.showIfInvisible();
+                    this.showIfNecessary();
                 } else {
                 } else {
                     q = q.toLowerCase();
                     q = q.toLowerCase();
                     matches = this.model.contacts.filter(contains.not('fullname', q));
                     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) {
                         _.each(this.model.contacts.reject(contains.not('fullname', q)), $.proxy(function (item) {
                             this.get(item.get('id')).$el.show();
                             this.get(item.get('id')).$el.show();
                         }, this));
                         }, 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();
                     this.$el.show();
                 }
                 }
             },
             },