* checkUnread - This function is used to add the unread class to the * text box if new contents (dialogs) were added to it causing it to overflow * but are not visible on screen right now so the player knows there is more * and scrolls the element.
()
| 49 | * and scrolls the element. |
| 50 | */ |
| 51 | checkUnread (): void { |
| 52 | const text = this.content('text').get(0) as HTMLElement | undefined; |
| 53 | |
| 54 | if (!text) { |
| 55 | return; |
| 56 | } |
| 57 | |
| 58 | if ((text.clientHeight + text.scrollTop) < text.scrollHeight) { |
| 59 | this.classList.add('unread'); |
| 60 | } else { |
| 61 | this.classList.remove('unread'); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | override async render (): Promise<string> { |
| 66 | // In NVL mode, we don't want a static type-writer element |
no test coverage detected