mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
91b23f0bb0
commit
c6122f2da1
2 changed files with 19 additions and 8 deletions
|
|
@ -141,13 +141,6 @@ export const setPadding = (protyle: IProtyle) => {
|
||||||
min24 = 96;
|
min24 = 96;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (protyle.options.render.background) {
|
|
||||||
protyle.background.element.lastElementChild.setAttribute("style", `left:${min16}px`);
|
|
||||||
protyle.background.element.querySelector(".protyle-background__img .protyle-icons").setAttribute("style", `right:${min16}px`);
|
|
||||||
}
|
|
||||||
if (protyle.options.render.title) {
|
|
||||||
protyle.title.element.style.margin = `16px ${min16}px 0 ${min24}px`;
|
|
||||||
}
|
|
||||||
let bottomHeight = "16px";
|
let bottomHeight = "16px";
|
||||||
if (protyle.options.typewriterMode) {
|
if (protyle.options.typewriterMode) {
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
|
|
@ -157,10 +150,26 @@ export const setPadding = (protyle: IProtyle) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (protyle.options.backlinkData) {
|
if (protyle.options.backlinkData) {
|
||||||
|
if ((min16 === min24 && protyle.wysiwyg.element.style.padding === `4px ${min16}px`) ||
|
||||||
|
(min16 !== min24 && protyle.wysiwyg.element.style.padding === `4px ${min16}px 4px ${min24}px`)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
protyle.wysiwyg.element.style.padding = `4px ${min16}px 4px ${min24}px`;
|
protyle.wysiwyg.element.style.padding = `4px ${min16}px 4px ${min24}px`;
|
||||||
} else {
|
} else {
|
||||||
|
// https://github.com/siyuan-note/siyuan/issues/8859
|
||||||
|
if ((min16 === min24 && protyle.wysiwyg.element.style.padding === `16px ${min16}px ${bottomHeight}`) ||
|
||||||
|
(min16 !== min24 && protyle.wysiwyg.element.style.padding === `16px ${min16}px ${bottomHeight} ${min24}px`)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
protyle.wysiwyg.element.style.padding = `16px ${min16}px ${bottomHeight} ${min24}px`;
|
protyle.wysiwyg.element.style.padding = `16px ${min16}px ${bottomHeight} ${min24}px`;
|
||||||
}
|
}
|
||||||
|
if (protyle.options.render.background) {
|
||||||
|
protyle.background.element.lastElementChild.setAttribute("style", `left:${min16}px`);
|
||||||
|
protyle.background.element.querySelector(".protyle-background__img .protyle-icons").setAttribute("style", `right:${min16}px`);
|
||||||
|
}
|
||||||
|
if (protyle.options.render.title) {
|
||||||
|
protyle.title.element.style.margin = `16px ${min16}px 0 ${min24}px`;
|
||||||
|
}
|
||||||
if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) {
|
if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) {
|
||||||
setTimeout(() => { // https://github.com/siyuan-note/siyuan/issues/5612
|
setTimeout(() => { // https://github.com/siyuan-note/siyuan/issues/5612
|
||||||
protyle.wysiwyg.element.querySelectorAll('.code-block [contenteditable="true"]').forEach((block: HTMLElement) => {
|
protyle.wysiwyg.element.querySelectorAll('.code-block [contenteditable="true"]').forEach((block: HTMLElement) => {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import {Constants} from "../../constants";
|
||||||
|
|
||||||
export const resize = (protyle: IProtyle) => {
|
export const resize = (protyle: IProtyle) => {
|
||||||
hideElements(["gutter"], protyle);
|
hideElements(["gutter"], protyle);
|
||||||
setPadding(protyle);
|
if (setPadding(protyle)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 不能 clearTimeout,否则 split 时左侧无法 resize
|
// 不能 clearTimeout,否则 split 时左侧无法 resize
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
if (typeof echarts !== "undefined") {
|
if (typeof echarts !== "undefined") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue