mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-20 21:34:20 -07:00
Fix scrolling behaivour
This commit is contained in:
parent
f5211d6ffe
commit
05a53192e2
2 changed files with 5 additions and 6 deletions
|
@ -178,12 +178,11 @@ haste.prototype.addLineNumbers = function(lineCount) {
|
|||
|
||||
if(window.location.hash) {
|
||||
const hash = window.location.hash.substring(1);
|
||||
highlightNew(getLineElement(hash));
|
||||
const lineElement = getLineElement(hash)
|
||||
highlightNew(lineElement);
|
||||
|
||||
getLineElement(hash).scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center'
|
||||
});
|
||||
const y = lineElement.getBoundingClientRect().top + window.pageYOffset;
|
||||
window.scrollTo({top: y, behavior: 'smooth'});
|
||||
}
|
||||
/*for (var i = 0; i < lineCount; i++) {
|
||||
let div = document.createElement('a');
|
||||
|
|
2
static/application.min.js
vendored
2
static/application.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue