Fixed some CSS bugs created with username format config.
This commit is contained in:
parent
cd5f168243
commit
eec9a35421
3 changed files with 28 additions and 13 deletions
|
|
@ -105,6 +105,7 @@ class chatPostprocessor{
|
|||
this.chatEntry.classList.add(
|
||||
`${classSuffixAlt}-buffer`,
|
||||
`${classSuffix}-entry`,
|
||||
`${classSuffix}-entry-${this.rawData.type}`,
|
||||
`${classSuffix}-entry-${this.rawData.user}`,
|
||||
`${classSuffix}-${color}`
|
||||
);
|
||||
|
|
@ -663,15 +664,22 @@ class chatPostprocessor{
|
|||
//add whisper class
|
||||
this.chatBody.classList.add('whisper');
|
||||
}else if(this.rawData.type == "announcement"){
|
||||
//Squash the high-level
|
||||
//Squash the high-level & timestamp
|
||||
this.chatEntry.querySelector('.high-level').remove();
|
||||
this.chatEntry.querySelector('.chat-entry-timestamp').remove();
|
||||
|
||||
//Get the username and make it into an announcement title (little hacky but this *IS* postprocessing)
|
||||
const userNode = this.chatEntry.querySelector('.chat-entry-username');
|
||||
userNode.textContent = `${userNode.textContent.slice(0,-2)} Announcement`;
|
||||
|
||||
//Get the username and make it into an announcement title (little hacky but this *IS* postprocessing)
|
||||
const flairNode = this.chatEntry.querySelector('.chat-entry-flair-span');
|
||||
flairNode.textContent = `${flairNode.textContent} Announcement`;
|
||||
|
||||
//Add/remove relevant classes
|
||||
userNode.classList.remove('chat-entry-username');
|
||||
flairNode.classList.add('announcement-title');
|
||||
flairNode.classList.remove('chat-entry-username');
|
||||
flairNode.classList.remove('chat-entry-flair');
|
||||
flairNode.classList.remove('flair-');
|
||||
userNode.classList.add('announcement-title');
|
||||
this.chatBody.classList.add('announcement-body');
|
||||
this.chatEntry.classList.add('announcement');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue