MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / checkUnread

Method checkUnread

src/components/text-box/index.ts:51–63  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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

Callers 2

bindMethod · 0.80
displayNvlDialogMethod · 0.80

Calls 3

getMethod · 0.65
removeMethod · 0.65
contentMethod · 0.45

Tested by

no test coverage detected