mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
da0e656ba6
commit
b5c45cbb45
7 changed files with 98 additions and 42 deletions
|
|
@ -11,11 +11,6 @@ import {fetchPost} from "../../util/fetch";
|
|||
export const initUI = (protyle: IProtyle) => {
|
||||
protyle.contentElement = document.createElement("div");
|
||||
protyle.contentElement.className = "protyle-content";
|
||||
if (window.siyuan.config.editor.fullWidth) {
|
||||
protyle.contentElement.setAttribute("data-fullwidth", "true");
|
||||
} else {
|
||||
protyle.contentElement.removeAttribute("data-fullwidth");
|
||||
}
|
||||
if (protyle.options.render.background) {
|
||||
protyle.contentElement.appendChild(protyle.background.element);
|
||||
}
|
||||
|
|
@ -129,7 +124,11 @@ export const setPadding = (protyle: IProtyle) => {
|
|||
let min24 = 24;
|
||||
if (!isMobile()) {
|
||||
let padding = (protyle.element.clientWidth - Constants.SIZE_EDITOR_WIDTH) / 2;
|
||||
if (!window.siyuan.config.editor.fullWidth && padding > 96) {
|
||||
let isFullWidth = protyle.wysiwyg.element.getAttribute("custom-sy-fullwidth");
|
||||
if (!isFullWidth) {
|
||||
isFullWidth = window.siyuan.config.editor.fullWidth ? "true" : "false";
|
||||
}
|
||||
if (isFullWidth === "false" && padding > 96) {
|
||||
if (padding > Constants.SIZE_EDITOR_WIDTH) {
|
||||
// 超宽屏调整 https://ld246.com/article/1668266637363
|
||||
padding = protyle.element.clientWidth * .382 / 1.382;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue