0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-20 15:44:54 +01:00

improvements

This commit is contained in:
Lunny Xiao 2025-12-12 12:16:48 -08:00
parent ff5544a329
commit a9d887a5e8
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -256,11 +256,9 @@ async function onLocationHashChange() {
// eslint-disable-next-line unicorn/prefer-query-selector
const commentElement = document.getElementById(hashValue);
if (commentElement) {
commentElement.scrollIntoView();
document.body.setAttribute(diffAutoScrollAttr, 'true');
commentElement.scrollIntoView({behavior: 'instant'});
window.location.hash = '';
window.location.hash = currentHash;
setTimeout(() => document.body.removeAttribute(diffAutoScrollAttr), 0);
return;
}
}