mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
use textContent
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
168b1d6247
commit
9ed6cd57f3
@ -25,8 +25,7 @@ export function renderStaticAvatar(vm, size, extraClasses = undefined) {
|
||||
let avatarClasses = classNames({
|
||||
avatar: true,
|
||||
[`size-${size}`]: true,
|
||||
[`usercolor${vm.avatarColorNumber}`]: true,
|
||||
['has-image']: true
|
||||
[`usercolor${vm.avatarColorNumber}`]: true
|
||||
});
|
||||
if (extraClasses) {
|
||||
avatarClasses += ` ${extraClasses}`;
|
||||
@ -50,7 +49,5 @@ export function handleAvatarError(e) {
|
||||
if (!isAvatarEvent(e)) { return; }
|
||||
const parent = e.target.parentElement;
|
||||
const avatarLetter = parent.getAttribute("data-avatar-letter");
|
||||
const letterNode = document.createTextNode(avatarLetter);
|
||||
parent.appendChild(letterNode);
|
||||
parent.classList.remove("has-image");
|
||||
parent.textContent = avatarLetter;
|
||||
}
|
||||
|
@ -31,10 +31,6 @@ limitations under the License.
|
||||
speak: none;
|
||||
}
|
||||
|
||||
.hydrogen .avatar:not(.has-image) img{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hydrogen .avatar img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
Loading…
Reference in New Issue
Block a user