mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 03:48:48 +01:00
This commit is contained in:
parent
53b7f45175
commit
dc5551aea8
2 changed files with 26 additions and 4 deletions
|
|
@ -56,6 +56,9 @@ export const genAVValueHTML = (value: IAVCellValue) => {
|
|||
<span class="fn__space"></span>
|
||||
<a href="tel:${value.phone.content}" target="_blank" aria-label="${window.siyuan.languages.openBy}" class="block__icon block__icon--show fn__flex-center b3-tooltips__w b3-tooltips"><svg><use xlink:href="#iconPhone"></use></svg></a>`;
|
||||
break;
|
||||
case "checkbox":
|
||||
html = `<svg class="av__checkbox" style="height: 17px;"><use xlink:href="#icon${value.checkbox.checked?"Check":"Uncheck"}"></use></svg>`;
|
||||
break;
|
||||
case "template":
|
||||
html = `<div class="fn__flex-1">${value.template.content}</div>`;
|
||||
break;
|
||||
|
|
@ -76,9 +79,17 @@ export const renderAVAttribute = (element: HTMLElement, id: string, protyle?: IP
|
|||
key: {
|
||||
type: TAVCol,
|
||||
name: string,
|
||||
options?: { name: string, color: string }[]
|
||||
options?: {
|
||||
name: string,
|
||||
color: string
|
||||
}[]
|
||||
},
|
||||
values: { keyID: string, id: string, blockID: string, type?: TAVCol & IAVCellValue } []
|
||||
values: {
|
||||
keyID: string,
|
||||
id: string,
|
||||
blockID: string,
|
||||
type?: TAVCol & IAVCellValue
|
||||
} []
|
||||
}[],
|
||||
blockIDs: string[],
|
||||
avID: string
|
||||
|
|
@ -128,6 +139,13 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone"].includes
|
|||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
const checkboxElement = hasClosestByAttribute(target, "data-type", "checkbox");
|
||||
if (checkboxElement) {
|
||||
popTextCell(protyle, [checkboxElement], "checkbox");
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
});
|
||||
element.querySelectorAll(".b3-text-field--text").forEach((item: HTMLInputElement) => {
|
||||
item.addEventListener("change", () => {
|
||||
|
|
|
|||
|
|
@ -339,13 +339,17 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem
|
|||
id,
|
||||
data: blockElement.getAttribute("updated"),
|
||||
});
|
||||
updateAttrViewCellAnimation(item);
|
||||
if (!hasClosestByClassName(cellElements[0], "custom-attr")) {
|
||||
updateAttrViewCellAnimation(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (doOperations.length > 0) {
|
||||
transaction(protyle, doOperations, undoOperations);
|
||||
}
|
||||
cellElements[0].classList.add("av__cell--select");
|
||||
if (!hasClosestByClassName(cellElements[0], "custom-attr")) {
|
||||
cellElements[0].classList.add("av__cell--select");
|
||||
}
|
||||
if (blockElement) {
|
||||
focusBlock(blockElement);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue