mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 01:44:07 +01:00
This commit is contained in:
parent
27ffdc45d7
commit
03546a8b1e
3 changed files with 9 additions and 10 deletions
|
|
@ -70,7 +70,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
}
|
||||
|
||||
const gutterElement = hasClosestByClassName(event.target, "av__gutter");
|
||||
if (gutterElement && gutterElement.parentElement.classList.contains("av__gutters")) {
|
||||
if (gutterElement) {
|
||||
const rowElement = hasClosestByClassName(gutterElement, "av__row");
|
||||
if (!rowElement) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1459,13 +1459,8 @@ export class WYSIWYG {
|
|||
// database 行块标
|
||||
const rowElement = hasClosestByClassName(event.target, "av__row");
|
||||
if (rowElement && rowElement.dataset.id) {
|
||||
const scrollElement = hasClosestByClassName(rowElement, "av__scroll");
|
||||
const guttersElement = rowElement.querySelector<HTMLElement>(".av__gutters");
|
||||
if (scrollElement && guttersElement) {
|
||||
const width = guttersElement.offsetWidth;
|
||||
guttersElement.style.top = `${rowElement.getBoundingClientRect().top}px`;
|
||||
guttersElement.style.left = `${scrollElement.getBoundingClientRect().left - width}px`;
|
||||
}
|
||||
const guttersElement = rowElement.querySelector(".av__gutters");
|
||||
guttersElement.setAttribute("style", `left:${rowElement.parentElement.parentElement.getBoundingClientRect().left - guttersElement.clientWidth}px;top:${rowElement.getBoundingClientRect().top}px`);
|
||||
}
|
||||
protyle.gutter.render(protyle, nodeElement, this.element);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue