diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 3eb931103..c18e881b0 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -927,7 +927,7 @@ export const zoomOut = (options: { if (options.focusId) { let focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${options.focusId}"]`); if (!focusElement) { - const unfoldResponse = await fetchSyncPost("/api/block/getUnfoldedParentID", {id:options.focusId}) + const unfoldResponse = await fetchSyncPost("/api/block/getUnfoldedParentID", {id: options.focusId}) options.focusId = unfoldResponse.data.parentID focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${unfoldResponse.data.parentID}"]`); } @@ -1219,14 +1219,14 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme }, { iconHTML: "", type: "readonly", - label: `
- + label: `
+ -1 || imgElement.parentElement.style.width.endsWith("vw")) ? parseInt(imgElement.parentElement.style.width.replace("calc(", "")) : 0}" class="b3-slider fn__block" max="100" min="1" step="1" type="range">
`, bind(element) { rangeElement = element.querySelector("input"); rangeElement.addEventListener("input", () => { img3115(assetElement); - imgElement.parentElement.style.width = rangeElement.value + "%"; + imgElement.parentElement.style.width = `calc(${rangeElement.value}% - 8px)`; imgElement.style.height = ""; rangeElement.parentElement.setAttribute("aria-label", `${rangeElement.value}%`); }); @@ -1831,7 +1831,7 @@ const genImageWidthMenu = (label: string, imgElement: HTMLElement, protyle: IPro click() { nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); img3115(imgElement.parentElement.parentElement); - imgElement.parentElement.style.width = label === window.siyuan.languages.default ? "" : label; + imgElement.parentElement.style.width = label === window.siyuan.languages.default ? "" : `calc(${label} - 8px)`; imgElement.style.height = ""; updateTransaction(protyle, id, nodeElement.outerHTML, html); focusBlock(nodeElement);