Avatar didn't update a second time due to `canvas` element being expected
This commit is contained in:
parent
b69440f875
commit
83bc851f20
@ -35,6 +35,7 @@
|
|||||||
- #1296: `embedded` view mode shows `chatbox-navback` arrow in header
|
- #1296: `embedded` view mode shows `chatbox-navback` arrow in header
|
||||||
- #1330: Missing room name in MUC invitation popup
|
- #1330: Missing room name in MUC invitation popup
|
||||||
- #1445: Participants list uses big font in embedded mode
|
- #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
|
- #1465: When highlighting a roster contact, they're incorrectly shown as online
|
||||||
- #1495: Mentions should always include a URI attribute
|
- #1495: Mentions should always include a URI attribute
|
||||||
- #1502: Fatal error when using prebind
|
- #1502: Fatal error when using prebind
|
||||||
|
@ -19,20 +19,20 @@ const AvatarMixin = {
|
|||||||
|
|
||||||
renderAvatar (el) {
|
renderAvatar (el) {
|
||||||
el = el || this.el;
|
el = el || this.el;
|
||||||
const canvas_el = el.querySelector('canvas');
|
const avatar_el = el.querySelector('canvas.avatar, svg.avatar');
|
||||||
if (_.isNull(canvas_el)) {
|
if (_.isNull(avatar_el)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.model.vcard) {
|
if (this.model.vcard) {
|
||||||
const data = {
|
const data = {
|
||||||
'classes': canvas_el.getAttribute('class'),
|
'classes': avatar_el.getAttribute('class'),
|
||||||
'width': canvas_el.width,
|
'width': avatar_el.getAttribute('width'),
|
||||||
'height': canvas_el.height,
|
'height': avatar_el.getAttribute('height'),
|
||||||
}
|
}
|
||||||
const image_type = this.model.vcard.get('image_type'),
|
const image_type = this.model.vcard.get('image_type'),
|
||||||
image = this.model.vcard.get('image');
|
image = this.model.vcard.get('image');
|
||||||
data['image'] = "data:" + image_type + ";base64," + image;
|
data['image'] = "data:" + image_type + ";base64," + image;
|
||||||
canvas_el.outerHTML = tpl_avatar(data);
|
avatar_el.outerHTML = tpl_avatar(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user