Vanessa 2024-03-08 23:39:18 +08:00
parent 92856c1c8c
commit e32f7919d0
2 changed files with 13 additions and 3 deletions

View file

@ -9,6 +9,10 @@
align-items: center;
line-height: 16px;
&--av span:hover {
color: var(--b3-protyle-inline-blockref-color);
}
& > div.protyle-attr--bookmark {
flex: 1;
}
@ -37,7 +41,7 @@
&--refcount {
right: -16px;
top: 12px; // https://github.com/siyuan-note/siyuan/issues/8784
top: 12px; // https://github.com/siyuan-note/siyuan/issues/8784
position: absolute;
line-height: 16px;
padding: 0 4px;

View file

@ -493,14 +493,17 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
aliasHTML = `<div class="protyle-attr--alias"><svg><use xlink:href="#iconA"></use></svg>${escapeHTML}</div>`;
} else if (key === "memo") {
memoHTML = `<div class="protyle-attr--memo b3-tooltips b3-tooltips__sw" aria-label="${escapeHTML}"><svg><use xlink:href="#iconM"></use></svg></div>`;
} else if (key === "custom-avs") {
avHTML = '<div class="protyle-attr--av"><svg><use xlink:href="#iconDatabase"></use></svg></div>';
} else if (key === "custom-avs" && data.new["av-names"]) {
avHTML = `<div class="protyle-attr--av"><svg><use xlink:href="#iconDatabase"></use></svg>${data.new["av-names"]}</div>`;
}
});
let nodeAttrHTML = bookmarkHTML + nameHTML + aliasHTML + memoHTML + avHTML;
if (protyle.block.rootID === operation.id) {
// 文档
if (protyle.title) {
if (data.new["custom-avs"] && !data.new["av-names"]) {
nodeAttrHTML += protyle.title.element.querySelector(".protyle-attr--av")?.outerHTML || "";
}
const refElement = protyle.title.element.querySelector(".protyle-attr--refcount");
if (refElement) {
nodeAttrHTML += refElement.outerHTML;
@ -566,6 +569,9 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
}, 450);
}
});
if (data.new["custom-avs"] && !data.new["av-names"]) {
nodeAttrHTML += item.lastElementChild.querySelector(".protyle-attr--av")?.outerHTML || "";
}
const refElement = item.lastElementChild.querySelector(".protyle-attr--refcount");
if (refElement) {
nodeAttrHTML += refElement.outerHTML;