mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
💄 行块标顶部对齐
This commit is contained in:
parent
16bbff1b79
commit
0212c53b07
1 changed files with 8 additions and 7 deletions
|
|
@ -2027,13 +2027,14 @@ data-type="fold"><svg style="width:10px${fold && fold === "1" ? "" : ";transform
|
|||
} else if (nodeElement.getAttribute("data-type") === "NodeBlockQueryEmbed") {
|
||||
rect = nodeElement.getBoundingClientRect();
|
||||
space = 0;
|
||||
} else if (rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 ||
|
||||
(rect.height > Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 && rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) * 2 + 8)) {
|
||||
marginHeight = (rect.height - this.element.clientHeight) / 2;
|
||||
} else if (!element.classList.contains("av__row") &&
|
||||
(nodeElement.getAttribute("data-type") === "NodeAttributeView" || element.getAttribute("data-type") === "NodeAttributeView") &&
|
||||
contentTop < rect.top) {
|
||||
marginHeight = 8;
|
||||
} else if (!element.classList.contains("av__row")) {
|
||||
if (rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 ||
|
||||
(rect.height > Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 && rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) * 2 + 8)) {
|
||||
marginHeight = (rect.height - this.element.clientHeight) / 2;
|
||||
} else if ((nodeElement.getAttribute("data-type") === "NodeAttributeView" || element.getAttribute("data-type") === "NodeAttributeView") &&
|
||||
contentTop < rect.top) {
|
||||
marginHeight = 8;
|
||||
}
|
||||
}
|
||||
this.element.style.top = `${Math.max(rect.top, contentTop) + marginHeight}px`;
|
||||
let left = rect.left - this.element.clientWidth - space;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue