Center scrolled view

This commit is contained in:
Kenox 2022-11-03 18:41:21 +01:00
commit 2774a0fcc6

View file

@ -233,7 +233,11 @@ haste.prototype.loadDocument = function(key) {
if(window.location.hash) { if(window.location.hash) {
const hash = window.location.hash.substring(1); const hash = window.location.hash.substring(1);
highlightLine(hash) highlightLine(hash)
document.getElementsByClassName("highlight")[0].scrollIntoView(); document.getElementsByClassName("highlight")[0].scrollIntoView({
behavior: 'auto',
block: 'center',
inline: 'center'
});
} }
} }
else { else {