mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +01:00
🎨 页面内容变化时保持 av 头尾
This commit is contained in:
parent
8641d0c6b2
commit
efd0828b9d
7 changed files with 79 additions and 63 deletions
|
|
@ -39,7 +39,11 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {
|
|||
if (protyle.scroll && !protyle.scroll.element.classList.contains("fn__none")) {
|
||||
clearTimeout(getIndexTimeout);
|
||||
getIndexTimeout = window.setTimeout(() => {
|
||||
const targetElement = document.elementFromPoint(elementRect.left + elementRect.width / 2, elementRect.top + 10);
|
||||
let targetElement = document.elementFromPoint(elementRect.left + elementRect.width / 2, elementRect.top + 10);
|
||||
if (targetElement.classList.contains("protyle-wysiwyg")) {
|
||||
// 恰好定位到块的中间时
|
||||
targetElement = document.elementFromPoint(elementRect.left + elementRect.width / 2, elementRect.top + 20);
|
||||
}
|
||||
const blockElement = hasClosestBlock(targetElement);
|
||||
if (!blockElement) {
|
||||
if ((protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") === "1" ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue