Fix linting errors

This commit is contained in:
JC Brand 2014-08-03 23:07:48 +02:00
parent 33d84a0c8e
commit 6a28420d09
2 changed files with 11 additions and 11 deletions

View File

@ -2946,7 +2946,7 @@
return name1 < name2 ? -1 : (name1 > name2? 1 : 0); return name1 < name2 ? -1 : (name1 > name2? 1 : 0);
} else { } else {
return STATUS_WEIGHTS[status1] < STATUS_WEIGHTS[status2] ? -1 : 1; return STATUS_WEIGHTS[status1] < STATUS_WEIGHTS[status2] ? -1 : 1;
}; }
}, },
subscribeToSuggestedItems: function (msg) { subscribeToSuggestedItems: function (msg) {
@ -3222,7 +3222,7 @@
this.set(_.extend({ this.set(_.extend({
description: DESC_GROUP_TOGGLE, description: DESC_GROUP_TOGGLE,
state: OPENED state: OPENED
}, attributes)) }, attributes));
// Collection of contacts belonging to this group. // Collection of contacts belonging to this group.
this.contacts = new converse.RosterContacts(); this.contacts = new converse.RosterContacts();
} }
@ -3275,7 +3275,7 @@
*/ */
var view = this.get(contact.get('id')); var view = this.get(contact.get('id'));
var index = this.model.contacts.indexOf(contact); var index = this.model.contacts.indexOf(contact);
if (index == 0) { if (index === 0) {
this.$el.after(view.render().el); this.$el.after(view.render().el);
} else if (index == (this.model.contacts.length-1)) { } else if (index == (this.model.contacts.length-1)) {
this.$el.nextUntil('dt').last().after(view.$el); this.$el.nextUntil('dt').last().after(view.$el);
@ -3457,7 +3457,7 @@
* position amongst the other groups in the roster. * position amongst the other groups in the roster.
*/ */
var index = this.model.indexOf(view.model); var index = this.model.indexOf(view.model);
if (index == 0) { if (index === 0) {
this.$el.prepend(view.$el); this.$el.prepend(view.$el);
} else if (index == (this.model.length-1)) { } else if (index == (this.model.length-1)) {
this.$('.roster-group').last().siblings('dd').last().after(view.$el); this.$('.roster-group').last().siblings('dd').last().after(view.$el);
@ -3479,7 +3479,7 @@
model: this.model.create({name: name, id: b64_sha1(name)}), model: this.model.create({name: name, id: b64_sha1(name)}),
}); });
this.add(name, view); this.add(name, view);
return this.positionGroup(view) return this.positionGroup(view);
}, },
addContactToGroup: function (contact, name) { addContactToGroup: function (contact, name) {
@ -3509,9 +3509,9 @@
} else { } else {
view = (new converse.RosterContactView({model: contact})).render(); view = (new converse.RosterContactView({model: contact})).render();
if ((contact.get('ask') === 'subscribe') || (contact.get('subscription') === 'from')) { if ((contact.get('ask') === 'subscribe') || (contact.get('subscription') === 'from')) {
this.addContactToGroup(contact, HEADER_PENDING_CONTACTS) this.addContactToGroup(contact, HEADER_PENDING_CONTACTS);
} else if (contact.get('requesting') === true) { } else if (contact.get('requesting') === true) {
this.addContactToGroup(contact, HEADER_REQUESTING_CONTACTS) this.addContactToGroup(contact, HEADER_REQUESTING_CONTACTS);
} }
} }
return this; return this;

View File

@ -137,7 +137,7 @@
function _clearContacts () { function _clearContacts () {
utils.clearBrowserStorage(); utils.clearBrowserStorage();
converse.rosterview.model.reset(); converse.rosterview.model.reset();
}; }
it("can be used to organize existing contacts", $.proxy(function () { it("can be used to organize existing contacts", $.proxy(function () {
_clearContacts(); _clearContacts();
@ -248,13 +248,13 @@
function _clearContacts () { function _clearContacts () {
utils.clearBrowserStorage(); utils.clearBrowserStorage();
converse.rosterview.model.reset(); converse.rosterview.model.reset();
}; }
function _addContacts () { function _addContacts () {
_clearContacts(); _clearContacts();
// Must be initialized, so that render is called and documentFragment set up. // Must be initialized, so that render is called and documentFragment set up.
utils.createContacts('pending').openControlBox().openContactsPanel(); utils.createContacts('pending').openControlBox().openContactsPanel();
}; }
it("can be collapsed under their own header", $.proxy(function () { it("can be collapsed under their own header", $.proxy(function () {
_addContacts(); _addContacts();
@ -359,7 +359,7 @@
function _clearContacts () { function _clearContacts () {
utils.clearBrowserStorage(); utils.clearBrowserStorage();
converse.rosterview.model.reset(); converse.rosterview.model.reset();
}; }
var _addContacts = function () { var _addContacts = function () {
_clearContacts(); _clearContacts();