mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-21 00:53:10 -07:00
Center scrolled view
This commit is contained in:
parent
77f70a4f39
commit
2774a0fcc6
1 changed files with 5 additions and 1 deletions
|
@ -233,7 +233,11 @@ haste.prototype.loadDocument = function(key) {
|
|||
if(window.location.hash) {
|
||||
const hash = window.location.hash.substring(1);
|
||||
highlightLine(hash)
|
||||
document.getElementsByClassName("highlight")[0].scrollIntoView();
|
||||
document.getElementsByClassName("highlight")[0].scrollIntoView({
|
||||
behavior: 'auto',
|
||||
block: 'center',
|
||||
inline: 'center'
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue