mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-21 15:56:10 +01:00
This commit is contained in:
parent
28232dd18c
commit
6215e1c6ab
2 changed files with 6 additions and 5 deletions
|
|
@ -28,7 +28,7 @@ export class InlineMath extends ToolbarItem {
|
|||
let hasMath = false;
|
||||
// https://github.com/siyuan-note/siyuan/issues/6007
|
||||
range.cloneContents().childNodes.forEach((item: HTMLElement) => {
|
||||
if ((item.nodeType !== 3 && item.getAttribute("data-type").indexOf("inline-math") > -1) ||
|
||||
if ((item.nodeType !== 3 && (item.getAttribute("data-type") || "").indexOf("inline-math") > -1) ||
|
||||
(item.nodeType == 3 && item.textContent === "")) {
|
||||
// 是否仅选中数学公式
|
||||
hasMath = true;
|
||||
|
|
|
|||
|
|
@ -901,14 +901,15 @@ export class Toolbar {
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (this.subElement.clientHeight <= window.innerHeight - nodeRect.bottom || this.subElement.clientHeight <= nodeRect.top) {
|
||||
const bottom = nodeRect.bottom === nodeRect.top ? nodeRect.bottom + 26 : nodeRect.bottom;
|
||||
if (this.subElement.clientHeight <= window.innerHeight - bottom || this.subElement.clientHeight <= nodeRect.top) {
|
||||
if (types.includes("inline-math") || isInlineMemo) {
|
||||
setPosition(this.subElement, nodeRect.left, nodeRect.bottom, nodeRect.height);
|
||||
setPosition(this.subElement, nodeRect.left, bottom, nodeRect.height || 26);
|
||||
} else {
|
||||
setPosition(this.subElement, nodeRect.left + (nodeRect.width - this.subElement.clientWidth) / 2, nodeRect.bottom, nodeRect.height);
|
||||
setPosition(this.subElement, nodeRect.left + (nodeRect.width - this.subElement.clientWidth) / 2, bottom, nodeRect.height || 26);
|
||||
}
|
||||
} else {
|
||||
setPosition(this.subElement, nodeRect.right, nodeRect.bottom);
|
||||
setPosition(this.subElement, nodeRect.right, bottom);
|
||||
}
|
||||
};
|
||||
const headerElement = this.subElement.querySelector(".block__icons");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue