mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 06:18:49 +01:00
This commit is contained in:
parent
21b76c1a72
commit
05f43779c6
1 changed files with 4 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ export class Gutter {
|
|||
let foldElement: Element;
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${(buttonElement.previousElementSibling || buttonElement.nextElementSibling).getAttribute("data-node-id")}"]`)).find(item => {
|
||||
const itemRect = item.getBoundingClientRect();
|
||||
const gutterTop = this.element.getBoundingClientRect().top;
|
||||
const gutterTop = this.element.getBoundingClientRect().top + 8;
|
||||
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed") &&
|
||||
itemRect.top <= gutterTop && itemRect.bottom >= gutterTop) {
|
||||
foldElement = item;
|
||||
|
|
@ -161,7 +161,7 @@ export class Gutter {
|
|||
let foldElement: Element;
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`)).find(item => {
|
||||
const itemRect = item.getBoundingClientRect();
|
||||
const gutterTop = this.element.getBoundingClientRect().top;
|
||||
const gutterTop = this.element.getBoundingClientRect().top + 8;
|
||||
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed") &&
|
||||
itemRect.top <= gutterTop && itemRect.bottom >= gutterTop) {
|
||||
foldElement = item;
|
||||
|
|
@ -235,7 +235,7 @@ export class Gutter {
|
|||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${buttonElement.getAttribute("data-node-id")}"]`)).find(item => {
|
||||
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed")) {
|
||||
const itemRect = item.getBoundingClientRect();
|
||||
const gutterTop = this.element.getBoundingClientRect().top;
|
||||
const gutterTop = this.element.getBoundingClientRect().top + 8;
|
||||
if (itemRect.top <= gutterTop && itemRect.bottom >= gutterTop) {
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--hl")).forEach(hlItem => {
|
||||
if (!item.isSameNode(hlItem)) {
|
||||
|
|
@ -670,7 +670,7 @@ export class Gutter {
|
|||
if (buttonElement.tagName === "BUTTON") {
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`)).find(item => {
|
||||
const itemRect = item.getBoundingClientRect();
|
||||
const gutterTop = this.element.getBoundingClientRect().top;
|
||||
const gutterTop = this.element.getBoundingClientRect().top + 8; // 缩放后小数点会有偏差
|
||||
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed") &&
|
||||
itemRect.top <= gutterTop && itemRect.bottom >= gutterTop) {
|
||||
nodeElement = item;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue