This commit is contained in:
Vanessa 2022-09-14 23:44:14 +08:00
parent b88d6e08ad
commit fbe8c2347f
2 changed files with 3 additions and 5 deletions

View file

@ -246,7 +246,7 @@
transition: var(--b3-transition);
}
span[data-type="file-annotation-ref"]:before {
span[data-type~="file-annotation-ref"]:before {
content: "🔖 ";
}

View file

@ -126,7 +126,7 @@ export class Toolbar {
});
const types = this.getCurrentType();
types.forEach(item => {
if (item === "block-ref" || item === "text") {
if (item === "block-ref" || item === "text" || item === "file-annotation-ref") {
return;
}
this.element.querySelector(`[data-type="${item}"]`).classList.add("protyle-toolbar__item--current");
@ -725,9 +725,7 @@ export class Toolbar {
focusByWbr(nodeElement, this.range);
});
const anchorElement = this.subElement.querySelector('[data-type="anchor"]') as HTMLInputElement;
if (refElement.getAttribute("data-subtype") === "s") {
anchorElement.value = refElement.textContent;
}
anchorElement.value = refElement.textContent;
anchorElement.addEventListener("change", (event) => {
refElement.after(document.createElement("wbr"));
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));