cleaner element selection, add css shadow

This commit is contained in:
aamunger
2023-03-08 14:44:15 -08:00
parent 745aa79d73
commit 605bde227c
2 changed files with 16 additions and 7 deletions

View File

@@ -54,6 +54,14 @@ function truncatedArrayOfString(id: string, buffer: string[], linesLimit: number
function scrollableArrayOfString(id: string, buffer: string[], container: HTMLElement, trustHtml: boolean) {
const scrollableDiv = document.createElement('div');
scrollableDiv.classList.add(scrollableClass);
scrollableDiv.onscroll = (e) => {
const target = e.target as HTMLElement;
if (target.scrollTop === 0) {
target.classList.remove('more-above');
} else {
target.classList.add('more-above');
}
};
if (buffer.length > 5000) {
container.appendChild(generateViewMoreElement(id, false));