Fixed mismatched comment generation.

This commit is contained in:
flash 2018-12-11 21:54:23 +01:00
parent 3fc0c05b28
commit 8d58bdb40e

View file

@ -223,9 +223,7 @@ function commentConstruct(comment: CommentPostInfo, layer: number = 0): HTMLElem
commentUser.className = 'comment__user comment__user--link';
commentUser.textContent = comment.username;
commentUser.href = '/profile?u=' + comment.user_id;
commentUser.style.color = comment.user_colour == null || (comment.user_colour & 0x40000000) > 0
? 'inherit'
: '#' + (comment.user_colour & 0xFFFFFF).toString(16);
commentUser.style.setProperty('--user-colour', colourGetCSS(comment.user_colour));
const commentLink: HTMLAnchorElement = commentInfo.appendChild(document.createElement('a'));
commentLink.className = 'comment__link';
@ -309,12 +307,6 @@ function commentConstruct(comment: CommentPostInfo, layer: number = 0): HTMLElem
const replyInfo: HTMLDivElement = replyContent.appendChild(document.createElement('div'));
replyInfo.className = 'comment__info';
const replyUser: HTMLDivElement = document.createElement('div');
replyUser.className = 'comment__user';
replyUser.textContent = comment.username;
replyUser.style.color = colourGetCSS(comment.user_colour);
replyInfo.appendChild(replyUser);
const replyText: HTMLTextAreaElement = replyContent.appendChild(document.createElement('textarea'));
replyText.className = 'comment__text input__textarea comment__text--input';
replyText.name = 'comment[text]';