1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-08 09:24:48 +00:00

scroll to top when opening article

This commit is contained in:
zumbiepig 2024-09-05 17:02:00 -07:00
parent 1a1afd4a7c
commit f9aa1650b8
No known key found for this signature in database
GPG Key ID: 17C891BE28B953DE

View File

@ -156,10 +156,12 @@ const navigate = {
const article = {
open: function (articleId: string) {
const modal = document.querySelector(`#article-${articleId}`) as HTMLElement | null;
if (modal) {
const modalContent = document.querySelector(`#article-${articleId} .article-content`) as HTMLElement | null;
if (modal && modalContent) {
articleAnimationLock = true;
modal.style.animation = 'article-open 0.5s ease-in-out';
modal.style.display = 'flex';
modalContent.scroll({ top: 0, left: 0, behavior: 'instant' });
modal.addEventListener(
'animationend',
() => {