|
@@ -59,6 +59,7 @@ import {Menu} from "../plugin/Menu";
|
|
|
import {getFirstBlock} from "../protyle/wysiwyg/getBlock";
|
|
|
import {popSearch} from "../mobile/menu/search";
|
|
|
import {showMessage} from "../dialog/message";
|
|
|
+import {img3115} from "../boot/compatibleVersion";
|
|
|
|
|
|
const renderAssetList = (element: Element, k: string, position: IPosition, exts: string[] = []) => {
|
|
|
fetchPost("/api/search/searchAsset", {
|
|
@@ -1188,8 +1189,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|
|
rangeElement.value = "0";
|
|
|
rangeElement.parentElement.setAttribute("aria-label", inputElement.value ? (inputElement.value + "px") : window.siyuan.languages.default);
|
|
|
|
|
|
- // 历史兼容
|
|
|
- assetElement.removeAttribute("style");
|
|
|
+ img3115(assetElement)
|
|
|
imgElement.parentElement.style.width = inputElement.value ? (inputElement.value + "px") : "";
|
|
|
imgElement.style.height = "";
|
|
|
});
|
|
@@ -1220,8 +1220,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|
|
bind(element) {
|
|
|
rangeElement = element.querySelector("input");
|
|
|
rangeElement.addEventListener("input", () => {
|
|
|
- // 历史兼容
|
|
|
- assetElement.removeAttribute("style");
|
|
|
+ img3115(assetElement)
|
|
|
imgElement.parentElement.style.width = rangeElement.value + "%";
|
|
|
imgElement.style.height = "";
|
|
|
rangeElement.parentElement.setAttribute("aria-label", `${rangeElement.value}%`);
|
|
@@ -1255,8 +1254,7 @@ 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.removeAttribute("style");
|
|
|
+ img3115(assetElement)
|
|
|
imgElement.parentElement.style.width = "";
|
|
|
});
|
|
|
inputElement.addEventListener("blur", () => {
|
|
@@ -1286,8 +1284,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|
|
bind(element) {
|
|
|
rangeHeightElement = element.querySelector("input");
|
|
|
rangeHeightElement.addEventListener("input", () => {
|
|
|
- // 历史兼容
|
|
|
- assetElement.removeAttribute("style");
|
|
|
+ img3115(assetElement)
|
|
|
imgElement.parentElement.style.width = "";
|
|
|
imgElement.style.height = rangeHeightElement.value + "vh";
|
|
|
rangeHeightElement.parentElement.setAttribute("aria-label", `${rangeHeightElement.value}%`);
|
|
@@ -1828,8 +1825,7 @@ const genImageWidthMenu = (label: string, imgElement: HTMLElement, protyle: IPro
|
|
|
label,
|
|
|
click() {
|
|
|
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
|
|
- // 历史兼容
|
|
|
- imgElement.parentElement.parentElement.removeAttribute("style");
|
|
|
+ img3115(imgElement.parentElement.parentElement)
|
|
|
imgElement.parentElement.style.width = label === window.siyuan.languages.default ? "" : label;
|
|
|
imgElement.style.height = "";
|
|
|
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
|
@@ -1845,8 +1841,7 @@ const genImageHeightMenu = (label: string, imgElement: HTMLElement, protyle: IPr
|
|
|
click() {
|
|
|
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
|
|
imgElement.style.height = label === window.siyuan.languages.default ? "" : parseInt(label) + "vh";
|
|
|
- // 历史兼容
|
|
|
- imgElement.parentElement.parentElement.removeAttribute("style");
|
|
|
+ img3115(imgElement.parentElement.parentElement)
|
|
|
imgElement.parentElement.style.width = "";
|
|
|
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
|
|
focusBlock(nodeElement);
|