mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
This commit is contained in:
parent
11c5f14de6
commit
982dfc95c9
2 changed files with 20 additions and 4 deletions
|
|
@ -398,11 +398,17 @@
|
|||
}
|
||||
|
||||
.img {
|
||||
display: initial; // inline-block 会导致 https://ld246.com/article/1677809509055
|
||||
// inline-block 会导致 https://ld246.com/article/1677809509055
|
||||
// initial 会导致 https://ld246.com/article/1678257197581?r=88250
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: top; // https://ld246.com/article/1647522074722
|
||||
margin: 0 auto;
|
||||
|
||||
&:not([style]) {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
& > span:nth-child(2) {
|
||||
max-width: calc(100% - 10px);
|
||||
position: relative;
|
||||
|
|
|
|||
|
|
@ -964,9 +964,19 @@ const genImageWidthMenu = (label: string, assetElement: HTMLElement, imgElement:
|
|||
label,
|
||||
click() {
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
assetElement.style.width = label === window.siyuan.languages.default ? "" : label;
|
||||
imgElement.style.width = label === window.siyuan.languages.default ? "" : "10000px";
|
||||
assetElement.style.maxWidth = label === window.siyuan.languages.default ? (imgElement.clientWidth + 10) + "px" : "";
|
||||
if (label === window.siyuan.languages.default) {
|
||||
if (assetElement.style.display === "block") {
|
||||
assetElement.style.width = "";
|
||||
assetElement.style.maxWidth = "";
|
||||
} else {
|
||||
assetElement.removeAttribute("style")
|
||||
}
|
||||
imgElement.removeAttribute("style")
|
||||
} else {
|
||||
assetElement.style.width = label;
|
||||
assetElement.style.maxWidth = "";
|
||||
imgElement.style.width = "10000px";
|
||||
}
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
focusBlock(nodeElement);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue