mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
fix: 移除浮窗和反链中多余的 .protyle-top 元素 (#13979)
fix https://github.com/siyuan-note/siyuan/issues/13873
This commit is contained in:
parent
b413b66e7f
commit
c3665aef8f
1 changed files with 12 additions and 5 deletions
|
|
@ -19,13 +19,20 @@ import {moveResize} from "../../dialog/moveResize";
|
|||
export const initUI = (protyle: IProtyle) => {
|
||||
protyle.contentElement = document.createElement("div");
|
||||
protyle.contentElement.className = "protyle-content";
|
||||
protyle.contentElement.innerHTML = '<div class="protyle-top"></div>';
|
||||
if (protyle.options.render.background) {
|
||||
protyle.contentElement.firstElementChild.appendChild(protyle.background.element);
|
||||
|
||||
const protyleTopElement = document.createElement("div");
|
||||
const shouldAddBackground = protyle.options.render.background;
|
||||
const shouldAddTitle = protyle.options.render.title;
|
||||
if (shouldAddBackground) {
|
||||
protyleTopElement.appendChild(protyle.background.element);
|
||||
}
|
||||
if (protyle.options.render.title) {
|
||||
protyle.contentElement.firstElementChild.appendChild(protyle.title.element);
|
||||
if (shouldAddTitle) {
|
||||
protyleTopElement.appendChild(protyle.title.element);
|
||||
}
|
||||
if (shouldAddBackground || shouldAddTitle) {
|
||||
protyle.contentElement.appendChild(protyleTopElement);
|
||||
}
|
||||
|
||||
protyle.contentElement.appendChild(protyle.wysiwyg.element);
|
||||
if (!protyle.options.action.includes(Constants.CB_GET_HISTORY)) {
|
||||
scrollEvent(protyle, protyle.contentElement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue