mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
bug-fix: add some margin for jumping title
This commit is contained in:
parent
fffae253c5
commit
9e5f3abb4b
@ -781,8 +781,8 @@ var jumpTitle = function(forward, relativeLevel, repeat) {
|
|||||||
if (targetLevel == -1 || level == targetLevel) {
|
if (targetLevel == -1 || level == targetLevel) {
|
||||||
if (targetIdx == currentHeaderIdx) {
|
if (targetIdx == currentHeaderIdx) {
|
||||||
// If current header is visible, skip it.
|
// If current header is visible, skip it.
|
||||||
content.setLog("scroll " + scrollTop + " " + headers[targetIdx].offsetTop);
|
// Minus 2 to tolerate some margin.
|
||||||
if (forward || scrollTop <= headers[targetIdx].offsetTop) {
|
if (forward || scrollTop - 2 <= headers[targetIdx].offsetTop) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user