(js) Improve sgAvatarImage

This commit is contained in:
Francis Lachapelle
2016-11-11 16:46:55 -05:00
parent 0a75f5c4f7
commit 3bbd61cfd2
18 changed files with 45 additions and 68 deletions
@@ -114,6 +114,7 @@
this.$$shortFormat = this.$shortFormat();
if (!this.$$image)
this.$$image = this.image;
this.$avatarIcon = (this.$isGroup() || this.$isSpecial()) ? 'group' : 'person';
// NOTE: We can't assign a Gravatar at this stage since we would need the Preferences module
// which already depend on the User module.
@@ -175,6 +176,15 @@
return deferred.promise;
};
/**
* @function $isGroup
* @memberof User.prototype
* @return true if the user actually represents a group of users
*/
User.prototype.$isGroup = function() {
return this.isGroup || this.userClass && this.userClass == 'normal-group';
};
/**
* @function $isAnonymous
* @memberof User.prototype