Vanessa 2024-05-12 11:27:33 +08:00
parent 7debd72d37
commit 47599388e2
2 changed files with 5 additions and 12 deletions

View file

@ -185,7 +185,7 @@ export const getEditHTML = (options: {
<span class="b3-menu__accelerator">${isSelf ? window.siyuan.languages.thisDatabase : ""}</span>
<svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>
</button>
<label class="b3-menu__item fn__none">
<label class="b3-menu__item">
<span class="fn__flex-center">${window.siyuan.languages.backRelation}</span>
<svg class="b3-menu__icon b3-menu__icon--small fn__none"><use xlink:href="#iconHelp"></use></svg>
<span class="fn__space fn__flex-1"></span>

View file

@ -186,16 +186,10 @@ export const toggleUpdateRelationBtn = (menuItemsElement: HTMLElement, avId: str
switchElement.checked = oldValue.isTwoWay;
}
}
if (searchElement.dataset.avId === avId && oldValue.avID === avId && oldValue.isTwoWay) {
switchItemElement.classList.add("fn__none");
inputItemElement.classList.add("fn__none");
if (switchElement.checked) {
inputItemElement.classList.remove("fn__none");
} else {
switchItemElement.classList.remove("fn__none");
if (switchElement.checked) {
inputItemElement.classList.remove("fn__none");
} else {
inputItemElement.classList.add("fn__none");
}
inputItemElement.classList.add("fn__none");
}
if ((searchElement.dataset.avId && oldValue.avID !== searchElement.dataset.avId) || oldValue.isTwoWay !== switchElement.checked || inputElement.dataset.oldValue !== inputElement.value) {
btnElement.classList.remove("fn__none");
@ -203,7 +197,6 @@ export const toggleUpdateRelationBtn = (menuItemsElement: HTMLElement, avId: str
btnElement.classList.add("fn__none");
}
} else if (searchElement.dataset.avId) {
switchItemElement.classList.remove("fn__none");
if (switchElement.checked) {
inputItemElement.classList.remove("fn__none");
} else {
@ -361,7 +354,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar
if (!nodeElement.contains(cellElements[0])) {
cellElements[0] = nodeElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement;
}
const newValue:IAVCellRelationValue = {blockIDs: [], contents: []};
const newValue: IAVCellRelationValue = {blockIDs: [], contents: []};
menuElement.querySelectorAll('[draggable="true"]').forEach(item => {
const id = item.getAttribute("data-id");
newValue.blockIDs.push(id);