Fixes #1455. Updates #1619

Avatar didn't update a second time due to `canvas` element being expected
This commit is contained in:
JC Brand 2019-06-26 10:24:27 +02:00
parent b69440f875
commit 83bc851f20
2 changed files with 7 additions and 6 deletions

View File

@ -35,6 +35,7 @@
- #1296: `embedded` view mode shows `chatbox-navback` arrow in header
- #1330: Missing room name in MUC invitation popup
- #1445: Participants list uses big font in embedded mode
- #1455: Avatar in controlbox status-view not updated
- #1465: When highlighting a roster contact, they're incorrectly shown as online
- #1495: Mentions should always include a URI attribute
- #1502: Fatal error when using prebind

View File

@ -19,20 +19,20 @@ const AvatarMixin = {
renderAvatar (el) {
el = el || this.el;
const canvas_el = el.querySelector('canvas');
if (_.isNull(canvas_el)) {
const avatar_el = el.querySelector('canvas.avatar, svg.avatar');
if (_.isNull(avatar_el)) {
return;
}
if (this.model.vcard) {
const data = {
'classes': canvas_el.getAttribute('class'),
'width': canvas_el.width,
'height': canvas_el.height,
'classes': avatar_el.getAttribute('class'),
'width': avatar_el.getAttribute('width'),
'height': avatar_el.getAttribute('height'),
}
const image_type = this.model.vcard.get('image_type'),
image = this.model.vcard.get('image');
data['image'] = "data:" + image_type + ";base64," + image;
canvas_el.outerHTML = tpl_avatar(data);
avatar_el.outerHTML = tpl_avatar(data);
}
},
};