mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-09 22:22:34 +01:00
🎨 防止遮挡可左右滚动的 cell
This commit is contained in:
parent
ec3acdb978
commit
b63bd96992
4 changed files with 13 additions and 6 deletions
|
|
@ -1916,11 +1916,18 @@ data-type="fold"><svg style="width:10px${fold && fold === "1" ? "" : ";transform
|
|||
}
|
||||
if (nodeElement.getAttribute("data-type") === "NodeAttributeView") {
|
||||
const iconElement = nodeElement.querySelector(".item__graphic");
|
||||
let top = rect.top + 8
|
||||
if (iconElement) {
|
||||
this.element.style.top = `${Math.max(iconElement.getBoundingClientRect().top - (window.siyuan.config.editor.fontSize * 1.625 - 14) / 2, wysiwyg.parentElement.getBoundingClientRect().top)}px`;
|
||||
} else {
|
||||
this.element.style.top = `${Math.max(rect.top, wysiwyg.parentElement.getBoundingClientRect().top) + 8}px`;
|
||||
top = iconElement.getBoundingClientRect().top - (window.siyuan.config.editor.fontSize * 1.625 - 14) / 2;
|
||||
}
|
||||
// 防止遮挡可左右滚动的 cell
|
||||
const maxTop = wysiwyg.parentElement.getBoundingClientRect().top
|
||||
if (top < maxTop - 43) {
|
||||
top = -1000
|
||||
} else if (top > maxTop - 43 && top <= maxTop) {
|
||||
top = maxTop
|
||||
}
|
||||
this.element.style.top = `${top}px`;
|
||||
} else {
|
||||
this.element.style.top = `${Math.max(rect.top, wysiwyg.parentElement.getBoundingClientRect().top) + marginHeight}px`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue