Commit 7daa681a authored by ichim-david's avatar ichim-david

Show dt elements on xmppchat-roster only if they have length and they are not...

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