Updated comments code to use colour functions.
This commit is contained in:
parent
d488902bd3
commit
1c0ca5fc33
2 changed files with 2 additions and 4 deletions
|
@ -23,7 +23,7 @@ function colourSetInherit(colour: number, enabled: boolean): number {
|
|||
}
|
||||
|
||||
function colourGetInherit(colour: number): boolean {
|
||||
return (colour & MSZ_COLOUR_INHERIT) > 0;
|
||||
return colour === null || (colour & MSZ_COLOUR_INHERIT) > 0;
|
||||
}
|
||||
|
||||
function colourGetRed(colour: number): number {
|
||||
|
|
|
@ -312,9 +312,7 @@ function commentConstruct(comment: CommentPostInfo, layer: number = 0): HTMLElem
|
|||
const replyUser: HTMLDivElement = document.createElement('div');
|
||||
replyUser.className = 'comment__user';
|
||||
replyUser.textContent = comment.username;
|
||||
replyUser.style.color = comment.user_colour == null || (comment.user_colour & 0x40000000) > 0
|
||||
? 'inherit'
|
||||
: '#' + (comment.user_colour & 0xFFFFFF).toString(16);
|
||||
replyUser.style.color = colourGetCSS(comment.user_colour);
|
||||
replyInfo.appendChild(replyUser);
|
||||
|
||||
const replyText: HTMLTextAreaElement = replyContent.appendChild(document.createElement('textarea'));
|
||||
|
|
Loading…
Add table
Reference in a new issue