Vanessa 2024-02-29 10:47:49 +08:00
parent d476ac09a3
commit b569365ae1
3 changed files with 14 additions and 0 deletions

View file

@ -496,6 +496,11 @@ export const openCardByData = async (app: App, cardsData: ICardData, cardType: T
if (lastRange) {
focusByRange(lastRange);
}
},
resizeCallback(type: string) {
if (type !== "d" && type !== "t" && editor) {
editor.resize();
}
}
});
(dialog.element.querySelector(".b3-dialog__scrim") as HTMLElement).style.backgroundColor = "var(--b3-theme-background)";
@ -509,6 +514,7 @@ export const openCardByData = async (app: App, cardsData: ICardData, cardType: T
cardType,
dialog
});
editor.resize();
dialog.editors = {
card: editor
};

View file

@ -57,6 +57,11 @@ export const viewCards = (app: App, deckID: string, title: string, deckType: "Tr
window.siyuan.mobile.popEditor = null;
}
}
},
resizeCallback(type: string) {
if (type !== "d" && type !== "t" && edit) {
edit.resize();
}
}
});
if (response.data.blocks.length > 0) {
@ -73,6 +78,7 @@ export const viewCards = (app: App, deckID: string, title: string, deckType: "Tr
dialog.editors = {
card: edit
};
edit.resize();
getArticle(edit, dialog.element.querySelector(".b3-list-item--focus")?.getAttribute("data-id"));
}
const previousElement = dialog.element.querySelector('[data-type="previous"]');

View file

@ -407,6 +407,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
breadcrumbDocName: true
},
});
edit.resize();
const unRefEdit = new Protyle(app, element.querySelector("#searchUnRefPreview") as HTMLElement, {
blockId: "",
render: {
@ -414,6 +415,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
breadcrumbDocName: true
},
});
unRefEdit.resize();
if (closeCB) {
if (data.layout === 1) {
if (data.col) {