Commit cdf0a0d2 authored by JC Brand's avatar JC Brand

Make sure contacts added to a collapsed group header are hidden.

updates #83
parent 5171d88c
......@@ -3291,7 +3291,10 @@
addContact: function (contact) {
var view = new converse.RosterContactView({model: contact});
this.add(contact.get('id'), view);
this.positionContact(contact).render();
var view = this.positionContact(contact).render();
if (this.model.get('state') === CLOSED) {
view.$el.hide();
}
this.$el.show();
},
......
......@@ -364,6 +364,22 @@
checkHeaderToggling.apply(this, [this.rosterview.$el.find('dt.roster-group')]);
}, converse));
it("will be hidden when appearing under a collapsed group", $.proxy(function () {
_addContacts();
this.rosterview.$el.find('dt.roster-group').find('a.group-toggle').click();
var name = "Max Mustermann";
var jid = name.replace(/ /g,'.').toLowerCase() + '@localhost';
converse.roster.create({
ask: null,
fullname: name,
jid: jid,
requesting: false,
subscription: 'both'
});
var view = this.rosterview.get('My contacts').get(jid);
expect(view.$el.is(':visible')).toBe(false);
}, converse));
it("can be added to the roster and they will be sorted alphabetically", $.proxy(function () {
_clearContacts();
var i, t;
......
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