fix: 调整目录偏移量及编辑器滚动定位的高度
This commit is contained in:
1 parent
c5c5f8c004
commit
3638d2cd78
3 files changed
+3
-3
No files matched your search
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
function trackPreview() {
|
function trackPreview() {
|
||||||
if (!preview || navigatingPreview) return;
|
if (!preview || navigatingPreview) return;
|
||||||
const top = preview.getBoundingClientRect().top + 24;
|
const top = preview.getBoundingClientRect().top + 120;
|
||||||
let active = -1;
|
let active = -1;
|
||||||
previewHeadings.forEach((heading, index) => {
|
previewHeadings.forEach((heading, index) => {
|
||||||
if (heading.getBoundingClientRect().top <= top) active = index;
|
if (heading.getBoundingClientRect().top <= top) active = index;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
scrollFrame = 0;
|
scrollFrame = 0;
|
||||||
if (!view || navigationPending) return;
|
if (!view || navigationPending) return;
|
||||||
const rect = view.contentDOM.getBoundingClientRect();
|
const rect = view.contentDOM.getBoundingClientRect();
|
||||||
const top = Math.max(toolbar.getBoundingClientRect().bottom + 12, rect.top + 1);
|
const top = Math.max(toolbar.getBoundingClientRect().bottom + 120, rect.top + 1);
|
||||||
if (top >= window.innerHeight || top >= rect.bottom) return;
|
if (top >= window.innerHeight || top >= rect.bottom) return;
|
||||||
const position = view.posAtCoords({ x: rect.left + 8, y: top }, false);
|
const position = view.posAtCoords({ x: rect.left + 8, y: top }, false);
|
||||||
if (position !== null) onPositionChange?.(position);
|
if (position !== null) onPositionChange?.(position);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
listItemClass: 'toc-list-item',
|
listItemClass: 'toc-list-item',
|
||||||
collapseDepth: 0,
|
collapseDepth: 0,
|
||||||
scrollSmooth: true,
|
scrollSmooth: true,
|
||||||
headingsOffset: 20
|
headingsOffset: 120
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.innerWidth < 1200) {
|
if (window.innerWidth < 1200) {
|
||||||
|
|||||||
Reference in new issue
Block a user