mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
cfc539b84a
commit
bad5918cf4
2 changed files with 25 additions and 12 deletions
|
|
@ -34,15 +34,6 @@
|
|||
border: 0;
|
||||
}
|
||||
|
||||
iframe {
|
||||
border: 1px solid var(--b3-theme-surface-lighter);
|
||||
width: 765px;
|
||||
box-sizing: border-box;
|
||||
height: 256px;
|
||||
max-width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
span[data-type~="sup"],
|
||||
span[data-type~="sub"] {
|
||||
position: relative;
|
||||
|
|
@ -415,6 +406,22 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
[data-subtype="NodeIFrame"],
|
||||
[data-subtype="widget"] {
|
||||
.iframe-content {
|
||||
width: 100%;
|
||||
height: 256px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid var(--b3-theme-surface-lighter);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
[data-subtype="flowchart"] > [spin="1"],
|
||||
[data-subtype="plantuml"] > [spin="1"],
|
||||
[data-subtype="mermaid"] > [spin="1"] {
|
||||
|
|
|
|||
|
|
@ -917,7 +917,7 @@ export class WYSIWYG {
|
|||
};
|
||||
return false;
|
||||
}
|
||||
// 图片、iframe、video 缩放
|
||||
// 图片、iframe、video、挂件缩放
|
||||
if (!protyle.disabled && target.classList.contains("protyle-action__drag")) {
|
||||
if (!nodeElement) {
|
||||
return;
|
||||
|
|
@ -925,7 +925,7 @@ export class WYSIWYG {
|
|||
let isCenter = true;
|
||||
if (["NodeIFrame", "NodeWidget", "NodeVideo"].includes(nodeElement.getAttribute("data-type"))) {
|
||||
nodeElement.classList.add("iframe--drag");
|
||||
if (nodeElement.style.textAlign === "left" || nodeElement.style.textAlign === "right") {
|
||||
if (["left", "right", ""].includes(nodeElement.style.textAlign)) {
|
||||
isCenter = false;
|
||||
}
|
||||
} else if (target.parentElement.parentElement.getAttribute("data-type") === "img") {
|
||||
|
|
@ -951,13 +951,19 @@ export class WYSIWYG {
|
|||
const multiple = ((dragElement.tagName === "IMG" && !imgElement.style.minWidth && nodeElement.style.textAlign !== "center") || !isCenter) ? 1 : 2;
|
||||
if (dragElement.tagName === "IMG") {
|
||||
dragElement.parentElement.style.width = Math.max(17, dragWidth + (moveEvent.clientX - x) * multiple) + "px";
|
||||
} else if (dragElement.tagName === "IFRAME") {
|
||||
dragElement.parentElement.style.width = Math.max(17, dragWidth + (moveEvent.clientX - x) * multiple) + "px";
|
||||
} else {
|
||||
dragElement.style.width = Math.max(17, dragWidth + (moveEvent.clientX - x) * multiple) + "px";
|
||||
}
|
||||
}
|
||||
if (dragElement.tagName !== "IMG") {
|
||||
if (moveEvent.clientY > y - dragHeight + 8 && moveEvent.clientY < mostBottom) {
|
||||
dragElement.style.height = (dragHeight + (moveEvent.clientY - y)) + "px";
|
||||
if (dragElement.tagName === "IFRAME") {
|
||||
dragElement.parentElement.style.height = (dragHeight + (moveEvent.clientY - y)) + "px";
|
||||
} else {
|
||||
dragElement.style.height = (dragHeight + (moveEvent.clientY - y)) + "px";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue