From 1eda7c85652c6e4295626ab94bc4084aaa141872 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 14 Feb 2021 22:26:07 +0900 Subject: Chat UI (#7197) * wip * wip * wip * wip * refactor * Update note.vue * wip --- src/client/scripts/scroll.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client/scripts/scroll.ts') diff --git a/src/client/scripts/scroll.ts b/src/client/scripts/scroll.ts index 18c3366891..bc6d1530c5 100644 --- a/src/client/scripts/scroll.ts +++ b/src/client/scripts/scroll.ts @@ -54,6 +54,14 @@ export function scroll(el: Element, top: number) { } } +export function scrollToTop(el: Element) { + scroll(el, 0); +} + +export function scrollToBottom(el: Element) { + scroll(el, 99999); // TODO: ちゃんと計算する +} + export function isBottom(el: Element, asobi = 0) { const container = getScrollContainer(el); const current = container -- cgit v1.2.3-freya