mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-29 21:08:49 +01:00
This commit is contained in:
parent
987f55fdb8
commit
8345eba602
1 changed files with 1 additions and 7 deletions
|
|
@ -220,13 +220,7 @@ export class Outline extends Model {
|
|||
}
|
||||
if (currentElement) {
|
||||
currentElement.classList.add("b3-list-item--focus");
|
||||
const currentRect = currentElement.getBoundingClientRect();
|
||||
const scrollRect = this.element.getBoundingClientRect();
|
||||
if (currentRect.top < scrollRect.top) {
|
||||
currentElement.scrollIntoView();
|
||||
} else if (currentRect.bottom > scrollRect.bottom) {
|
||||
currentElement.scrollIntoView(false);
|
||||
}
|
||||
this.element.scrollTop = currentElement.offsetTop - this.element.clientHeight / 2 - 30;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue