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:
parent
1a1afd4a7c
commit
f9aa1650b8
@ -156,10 +156,12 @@ const navigate = {
|
|||||||
const article = {
|
const article = {
|
||||||
open: function (articleId: string) {
|
open: function (articleId: string) {
|
||||||
const modal = document.querySelector(`#article-${articleId}`) as HTMLElement | null;
|
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;
|
articleAnimationLock = true;
|
||||||
modal.style.animation = 'article-open 0.5s ease-in-out';
|
modal.style.animation = 'article-open 0.5s ease-in-out';
|
||||||
modal.style.display = 'flex';
|
modal.style.display = 'flex';
|
||||||
|
modalContent.scroll({ top: 0, left: 0, behavior: 'instant' });
|
||||||
modal.addEventListener(
|
modal.addEventListener(
|
||||||
'animationend',
|
'animationend',
|
||||||
() => {
|
() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user