From 197e237a666d6054e2d81112297742705e130f9e Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 25 Jul 2016 14:55:59 -0400 Subject: [PATCH] (js) Fix avatar in autocompletion of contacts --- NEWS | 1 + UI/WebServerResources/js/Contacts/Card.service.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 67d71b706..ba7749385 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Bug fixes - [web] fixed exception when moving tasks to a different calendar - [web] fixed printing of long mail (#3731) - [web] fixed position of ghost block when creating an event from DnD + - [web] fixed avatar image in autocompletion - [eas] fixed long GUID issue preventing sometimes synchronisation (#3460) 3.1.4 (2016-07-12) diff --git a/UI/WebServerResources/js/Contacts/Card.service.js b/UI/WebServerResources/js/Contacts/Card.service.js index 09acffaf8..29394e6fe 100644 --- a/UI/WebServerResources/js/Contacts/Card.service.js +++ b/UI/WebServerResources/js/Contacts/Card.service.js @@ -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;