(js) Fix possible errors (help from jsjint)

This commit is contained in:
Francis Lachapelle
2015-07-24 16:14:53 -04:00
parent e064dc4a46
commit dc9a0896e5
27 changed files with 166 additions and 157 deletions
@@ -59,7 +59,10 @@
User.$query = search;
return User.$$resource.fetch(null, 'usersSearch', param).then(function(response) {
var results, index, user;
var results, index, user,
compareUids = function(data) {
return user.uid == data.uid;
};
if (excludedUsers) {
// Remove excluded users from response
results = _.filter(response.users, function(data) {
@@ -84,9 +87,7 @@
// Remove users that no longer match the search query
for (index = User.$users.length - 1; index >= 0; index--) {
user = User.$users[index];
if (!_.find(results, function(data) {
return user.uid == data.uid;
})) {
if (!_.find(results, compareUids)) {
User.$users.splice(index, 1);
}
}
@@ -109,10 +110,6 @@
this.$$image = this.image || User.$gravatar(this.c_email);
};
User.prototype.toString = function() {
return '[User ' + this.c_email + ']';
};
/**
* @function $shortFormat
* @memberof User.prototype
@@ -276,4 +273,8 @@
return user;
};
User.prototype.toString = function() {
return '[User ' + this.c_email + ']';
};
})();