فهرست منبع

Show dt elements on xmppchat-roster only if they have length and they are not already visible to avoid making them all the time visible when they might already be so

ichim-david 12 سال پیش
والد
کامیت
7daa681ac3
1فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 6 6
      converse.js

+ 6 - 6
converse.js

@@ -1610,7 +1610,7 @@
             this.model.on("remove", function (item) {
                 // remove element from the rosterView instance
                 this.rosteritemviews[item.id].$el.remove();
-                
+
                 delete this.rosteritemviews[item.id];
             }, this);
 
@@ -1626,9 +1626,9 @@
             if (!item) {
                 return this;
             }
-            var $my_contacts = this.$el.find('#xmpp-contacts').show(),
-                $contact_requests = this.$el.find('#xmpp-contact-requests').show(),
-                $pending_contacts = this.$el.find('#pending-xmpp-contacts').show(),
+            var $my_contacts = this.$el.find('#xmpp-contacts'),
+                $contact_requests = this.$el.find('#xmpp-contact-requests'),
+                $pending_contacts = this.$el.find('#pending-xmpp-contacts'),
                 $count, num, presence_change;
             var user_id = Strophe.getNodeFromJid(item.id),
                     view = this.rosteritemviews[item.id],
@@ -1676,8 +1676,8 @@
             }
             // Hide the headings if there are no contacts under them
             _.each([$my_contacts, $contact_requests, $pending_contacts], function (h) {
-                if (!h.nextUntil('dt').length) {
-                    h.hide();
+                if (h.nextUntil('dt').length && !h.is('visible')) {
+                    h.show();
                 }
             });
             $count = $('#online-count');