mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 08:30:42 +08:00
This commit is contained in:
parent
27ffdc45d7
commit
03546a8b1e
@ -63,7 +63,11 @@
|
||||
|
||||
&__gutters {
|
||||
@extend .protyle-gutters;
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: -44px;
|
||||
opacity: 0;
|
||||
display: flex;
|
||||
z-index: 2;
|
||||
|
||||
svg {
|
||||
@ -105,7 +109,7 @@
|
||||
}
|
||||
|
||||
.av__gutters {
|
||||
display: flex;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user