scroll to the bottom of scrollable outputs

This commit is contained in:
aamunger
2023-03-07 10:53:23 -08:00
parent d7e0649d25
commit 4b6837ca34
2 changed files with 68 additions and 41 deletions

View File

@@ -5,6 +5,8 @@
import { handleANSIOutput } from './ansi';
export const scrollableClass = 'scrollable';
function generateViewMoreElement(outputId: string, adjustableSize: boolean) {
const container = document.createElement('span');
const first = document.createElement('span');
@@ -51,7 +53,7 @@ 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('scrollable');
scrollableDiv.classList.add(scrollableClass);
if (buffer.length > 5000) {
container.appendChild(generateViewMoreElement(id, false));