mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-21 04:03:09 -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) {
|
if(window.location.hash) {
|
||||||
const hash = window.location.hash.substring(1);
|
const hash = window.location.hash.substring(1);
|
||||||
highlightNew(getLineElement(hash));
|
const lineElement = getLineElement(hash)
|
||||||
|
highlightNew(lineElement);
|
||||||
|
|
||||||
getLineElement(hash).scrollIntoView({
|
const y = lineElement.getBoundingClientRect().top + window.pageYOffset;
|
||||||
behavior: 'smooth',
|
window.scrollTo({top: y, behavior: 'smooth'});
|
||||||
block: 'center'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/*for (var i = 0; i < lineCount; i++) {
|
/*for (var i = 0; i < lineCount; i++) {
|
||||||
let div = document.createElement('a');
|
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