Vanessa 2023-06-11 10:22:05 +08:00
parent 1b9e2fe35d
commit 8b6a29b32c
4 changed files with 12 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

View file

@ -1,4 +1,6 @@
.av { .av {
user-select: none;
&__mask { &__mask {
position: fixed; position: fixed;
z-index: 320; z-index: 320;

View file

@ -1403,7 +1403,7 @@ export class Gutter {
window.siyuan.menus.menu.append(new MenuItem({ window.siyuan.menus.menu.append(new MenuItem({
accelerator: `${updateHotkeyTip(window.siyuan.config.keymap.general.enter.custom)}/${updateHotkeyTip("⌘Click")}`, accelerator: `${updateHotkeyTip(window.siyuan.config.keymap.general.enter.custom)}/${updateHotkeyTip("⌘Click")}`,
label: window.siyuan.languages.enter, label: window.siyuan.languages.enter,
click:()=> { click: () => {
zoomOut({protyle, id}); zoomOut({protyle, id});
} }
}).element); }).element);
@ -1425,7 +1425,7 @@ export class Gutter {
/// #endif /// #endif
} }
} else { } else {
zoomOut({protyle, id:protyle.block.parent2ID, focusId:id}); zoomOut({protyle, id: protyle.block.parent2ID, focusId: id});
} }
} }
}).element); }).element);
@ -1883,6 +1883,8 @@ export class Gutter {
if (nodeElement.getAttribute("data-type") === "NodeBlockQueryEmbed" && this.element.childElementCount === 1) { if (nodeElement.getAttribute("data-type") === "NodeBlockQueryEmbed" && this.element.childElementCount === 1) {
// 嵌入块为列表时 // 嵌入块为列表时
left = nodeElement.getBoundingClientRect().left - this.element.clientWidth - space; left = nodeElement.getBoundingClientRect().left - this.element.clientWidth - space;
} else if (nodeElement.getAttribute("data-type") === "NodeAttributeView") {
left = left + (parseInt((nodeElement.firstElementChild.firstElementChild as HTMLElement)?.style.paddingLeft) || 0);
} }
this.element.style.left = `${left}px`; this.element.style.left = `${left}px`;
if (left < this.element.parentElement.getBoundingClientRect().left) { if (left < this.element.parentElement.getBoundingClientRect().left) {

View file

@ -55,13 +55,13 @@ export const avRender = (element: Element) => {
}); });
tableHTML += "<div></div></div>"; tableHTML += "<div></div></div>";
}); });
const paddingLeft = e.parentElement.style.paddingLeft; const paddingLeft = parseInt(e.parentElement.style.paddingLeft) - 20;
const paddingRight = e.parentElement.style.paddingRight; const paddingRight = parseInt(e.parentElement.style.paddingRight) - 20
// 10: ::-webkit-scrollbar width // 48: padding for gutter icon
e.style.width = (e.parentElement.clientWidth - 10) + "px"; e.style.width = (e.parentElement.clientWidth - 48) + "px";
e.style.alignSelf = "center"; e.style.alignSelf = "center";
e.firstElementChild.outerHTML = `<div> e.firstElementChild.outerHTML = `<div>
<div style="padding-left: ${paddingLeft};padding-right: ${paddingRight}"> <div style="padding-left: ${paddingLeft}px;padding-right: ${paddingRight}px">
<div> <div>
<div>tab1</div> <div>tab1</div>
</div> </div>
@ -70,7 +70,7 @@ export const avRender = (element: Element) => {
</div> </div>
</div> </div>
<div class="av__scroll"> <div class="av__scroll">
<div style="padding-left: ${paddingLeft};padding-right: ${paddingRight};float: left;"> <div style="padding-left: ${paddingLeft}px;padding-right: ${paddingRight}px;float: left;">
${tableHTML} ${tableHTML}
<div class="block__icon block__icon--show"> <div class="block__icon block__icon--show">
<div class="fn__space"></div> <div class="fn__space"></div>