Commit 83bc851f authored by JC Brand's avatar JC Brand

Fixes #1455. Updates #1619

Avatar didn't update a second time due to `canvas` element being expected
parent b69440f8
......@@ -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
......
......@@ -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);
}
},
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment