Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/12423

Vanessadddae14b0a93
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index cdfb0fd546..51cd3b038f 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -1147,12 +1147,15 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
const inputElement = element.querySelector("input");
inputElement.addEventListener("input", () => {
rangeElement.value = "0";
- rangeElement.parentElement.setAttribute("aria-label", inputElement.value + "px");
+ rangeElement.parentElement.setAttribute("aria-label", inputElement.value ? (inputElement.value + "px") : window.siyuan.languages.default);
- imgElement.style.width = inputElement.value + "px";
+ imgElement.style.width = inputElement.value ? (inputElement.value + "px") : "";
imgElement.style.height = "";
});
inputElement.addEventListener("blur", () => {
+ if (inputElement.value === imgElement.style.width.replace("px", "")) {
+ return
+ }
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
updateTransaction(protyle, id, nodeElement.outerHTML, html);
window.siyuan.menus.menu.remove();
@@ -1206,13 +1209,16 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
const inputElement = element.querySelector("input");
inputElement.addEventListener("input", () => {
rangeHeightElement.value = "0";
- rangeHeightElement.parentElement.setAttribute("aria-label", inputElement.value + "px");
+ rangeHeightElement.parentElement.setAttribute("aria-label", inputElement.value ? (inputElement.value + "px") : window.siyuan.languages.default);
- imgElement.style.height = inputElement.value + "px";
+ imgElement.style.height = inputElement.value ? (inputElement.value + "px") : "";
assetElement.style.width = "";
imgElement.style.width = "";
});
inputElement.addEventListener("blur", () => {
+ if (inputElement.value === imgElement.style.height.replace("px", "")) {
+ return
+ }
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
updateTransaction(protyle, id, nodeElement.outerHTML, html);
window.siyuan.menus.menu.remove();