(js) Fix avatar in autocompletion of contacts

This commit is contained in:
Francis Lachapelle
2016-07-25 14:55:59 -04:00
parent 6a608425f2
commit 197e237a66
2 changed files with 8 additions and 1 deletions
@@ -136,6 +136,8 @@
* @param {object} data - attributes of card
*/
Card.prototype.init = function(data, partial) {
var _this = this;
this.refs = [];
this.categories = [];
this.c_screenname = null;
@@ -145,7 +147,11 @@
if (!this.$$email)
this.$$email = this.$preferredEmail(partial);
if (!this.$$image)
this.$$image = this.image || Card.$Preferences.avatar(this.$$email, 32, {no_404: true});
this.$$image = this.image;
if (!this.$$image)
Card.$Preferences.avatar(this.$$email, 32, {no_404: true}).then(function(url) {
_this.$$image = url;
});
if (this.isgroup)
this.c_component = 'vlist';
this.$loaded = angular.isDefined(this.c_name)? Card.STATUS.LOADED : Card.STATUS.NOT_LOADED;