mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 02:40:54 +08:00
This commit is contained in:
parent
b1617a3d0a
commit
504d3f6155
@ -335,13 +335,13 @@ export const bindEditEvent = (options: {
|
||||
});
|
||||
const goSearchElement = options.menuElement.querySelector('[data-type="goSearchAV"]') as HTMLElement;
|
||||
const oldValue = JSON.parse(goSearchElement.getAttribute("data-old-value"))
|
||||
const inputElement = options.menuElement.querySelector('[data-type="colName"]') as HTMLInputElement
|
||||
const inputElement = options.menuElement.querySelector('[data-type="colName"]') as HTMLInputElement
|
||||
inputElement.addEventListener("input", () => {
|
||||
toggleUpdateRelationBtn(options.menuElement, avID);
|
||||
})
|
||||
if (oldValue.avID) {
|
||||
fetchPost("/api/av/getAttributeView", {id: oldValue.avID}, (response) => {
|
||||
goSearchElement.querySelector(".b3-menu__accelerator").textContent = response.data.av.name || window.siyuan.languages.title;
|
||||
goSearchElement.querySelector(".b3-menu__accelerator").textContent = oldValue.avID === avID ? window.siyuan.languages.thisDatabase : (response.data.av.name || window.siyuan.languages.title)
|
||||
response.data.av.keyValues.find((item: { key: { id: string, name: string } }) => {
|
||||
if (item.key.id === oldValue.backKeyID) {
|
||||
inputElement.setAttribute("data-old-value", item.key.name || window.siyuan.languages.title);
|
||||
|
@ -123,7 +123,7 @@ export const toggleUpdateRelationBtn = (menuItemsElement: HTMLElement, avId: str
|
||||
const btnElement = inputItemElement.nextElementSibling;
|
||||
const oldValue = JSON.parse(searchElement.dataset.oldValue);
|
||||
if (oldValue.avID) {
|
||||
if (searchElement.dataset.avId !== avId) {
|
||||
if (searchElement.dataset.avId !== avId || (searchElement.dataset.avId === avId && oldValue.avID !== avId)) {
|
||||
switchItemElement.classList.remove("fn__none");
|
||||
if (switchElement.checked) {
|
||||
inputItemElement.classList.remove("fn__none");
|
||||
|
Loading…
Reference in New Issue
Block a user