This commit is contained in:
Vanessa 2023-03-16 11:19:46 +08:00
parent e0ebc536d5
commit 5781bb6356
3 changed files with 13 additions and 13 deletions

View file

@ -294,7 +294,7 @@ const genAttr = (attrs: IObject, focusName = "bookmark", cb: (dialog: Dialog, rm
}
bindAttrInput(item, btnsElement[2]);
});
}
};
export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark") => {
genAttr(attrs, focusName, (dialog) => {
@ -307,7 +307,7 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
if (item.tagName === "INPUT") {
return;
}
name = "custom-" + (item.parentElement.querySelector(".b3-text-field") as HTMLInputElement).value
name = "custom-" + (item.parentElement.querySelector(".b3-text-field") as HTMLInputElement).value;
}
if (item.value.trim()) {
if (!/^[0-9a-zA-Z\-]*$/.test(name.replace("custom-", "")) || name === "custom-") {
@ -359,7 +359,7 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
/// #endif
});
dialog.destroy();
})
});
};
export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "bookmark") => {
@ -378,7 +378,7 @@ export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "b
if (item.tagName === "INPUT") {
return;
}
name = "custom-" + (item.parentElement.querySelector(".b3-text-field") as HTMLInputElement).value
name = "custom-" + (item.parentElement.querySelector(".b3-text-field") as HTMLInputElement).value;
}
if (item.value.trim()) {
if (!/^[0-9a-zA-Z\-]*$/.test(name.replace("custom-", "")) || name === "custom-") {
@ -432,7 +432,7 @@ export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "b
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML);
dialog.destroy();
})
});
});
};