mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
27ffdc45d7
commit
03546a8b1e
3 changed files with 9 additions and 10 deletions
|
|
@ -63,7 +63,11 @@
|
||||||
|
|
||||||
&__gutters {
|
&__gutters {
|
||||||
@extend .protyle-gutters;
|
@extend .protyle-gutters;
|
||||||
display: none;
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: -44px;
|
||||||
|
opacity: 0;
|
||||||
|
display: flex;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
|
|
@ -105,7 +109,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.av__gutters {
|
.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");
|
const gutterElement = hasClosestByClassName(event.target, "av__gutter");
|
||||||
if (gutterElement && gutterElement.parentElement.classList.contains("av__gutters")) {
|
if (gutterElement) {
|
||||||
const rowElement = hasClosestByClassName(gutterElement, "av__row");
|
const rowElement = hasClosestByClassName(gutterElement, "av__row");
|
||||||
if (!rowElement) {
|
if (!rowElement) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1459,13 +1459,8 @@ export class WYSIWYG {
|
||||||
// database 行块标
|
// database 行块标
|
||||||
const rowElement = hasClosestByClassName(event.target, "av__row");
|
const rowElement = hasClosestByClassName(event.target, "av__row");
|
||||||
if (rowElement && rowElement.dataset.id) {
|
if (rowElement && rowElement.dataset.id) {
|
||||||
const scrollElement = hasClosestByClassName(rowElement, "av__scroll");
|
const guttersElement = rowElement.querySelector(".av__gutters");
|
||||||
const guttersElement = rowElement.querySelector<HTMLElement>(".av__gutters");
|
guttersElement.setAttribute("style", `left:${rowElement.parentElement.parentElement.getBoundingClientRect().left - guttersElement.clientWidth}px;top:${rowElement.getBoundingClientRect().top}px`);
|
||||||
if (scrollElement && guttersElement) {
|
|
||||||
const width = guttersElement.offsetWidth;
|
|
||||||
guttersElement.style.top = `${rowElement.getBoundingClientRect().top}px`;
|
|
||||||
guttersElement.style.left = `${scrollElement.getBoundingClientRect().left - width}px`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
protyle.gutter.render(protyle, nodeElement, this.element);
|
protyle.gutter.render(protyle, nodeElement, this.element);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue