diff --git a/app/src/assets/scss/component/_typography.scss b/app/src/assets/scss/component/_typography.scss
index 8ce3ee588..282874c83 100644
--- a/app/src/assets/scss/component/_typography.scss
+++ b/app/src/assets/scss/component/_typography.scss
@@ -441,14 +441,18 @@
}
.protyle-action__title {
- width: 100%;
- display: block;
+ display: flex;
font-size: 85%;
color: var(--b3-theme-on-surface);
word-break: break-word;
white-space: break-spaces;
line-height: normal;
padding: 4px 0;
+
+ & > span {
+ flex-grow: 1;
+ width: 0;
+ }
}
}
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index f615db85a..bcdcfbfcf 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -1173,7 +1173,6 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
alignImgLeft(protyle, nodeElement, [assetElement], id, html);
}
}).element);
- const width = imgElement.style.width.endsWith("vw") ? parseInt(imgElement.style.width) : 0;
let rangeElement: HTMLInputElement;
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.width,
@@ -1181,7 +1180,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
iconHTML: "",
type: "readonly",
label: `
- px
+px
`,
bind(element) {
const inputElement = element.querySelector("input");
@@ -1213,13 +1212,13 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
}, {
iconHTML: "",
type: "readonly",
- label: `
-
+ label: `
+
`,
bind(element) {
rangeElement = element.querySelector("input");
rangeElement.addEventListener("input", () => {
- imgElement.style.width = rangeElement.value + "vw";
+ imgElement.style.width = rangeElement.value + "%";
rangeElement.parentElement.setAttribute("aria-label", `${rangeElement.value}%`);
});
rangeElement.addEventListener("change", () => {
@@ -1236,14 +1235,13 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
]
}).element);
let rangeHeightElement: HTMLInputElement;
- const height = imgElement.style.height.endsWith("vh") ? parseInt(imgElement.style.height) : 0;
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.height,
submenu: [{
iconHTML: "",
type: "readonly",
label: `
- px
+px
`,
bind(element) {
const inputElement = element.querySelector("input");
@@ -1252,7 +1250,6 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
rangeHeightElement.parentElement.setAttribute("aria-label", inputElement.value ? (inputElement.value + "px") : window.siyuan.languages.default);
imgElement.style.height = inputElement.value ? (inputElement.value + "px") : "";
- assetElement.style.width = "";
imgElement.style.width = "";
});
inputElement.addEventListener("blur", () => {
@@ -1276,13 +1273,12 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
}, {
iconHTML: "",
type: "readonly",
- label: `