This commit is contained in:
Vanessa 2022-08-31 13:19:03 +08:00
parent c8bc6f3013
commit 5d70f3cf64
5 changed files with 19 additions and 19 deletions

View file

@ -202,7 +202,7 @@ export const editor = {
onSetEditor: (editor: IEditor) => {
window.siyuan.config.editor = editor;
getAllModels().editor.forEach((item) => {
reloadProtyle(item.editor.protyle)
reloadProtyle(item.editor.protyle);
setPadding(item.editor.protyle);
if (window.siyuan.config.editor.fullWidth) {
item.editor.protyle.contentElement.setAttribute("data-fullwidth", "true");

View file

@ -100,7 +100,7 @@ class Protyle {
size: Constants.SIZE_GET,
}, getResponse => {
onGet(getResponse, this.protyle);
})
});
} else {
reloadProtyle(this.protyle);
}

View file

@ -19,4 +19,4 @@ export const reloadProtyle = (protyle:IProtyle) => {
}, getResponse => {
onGet(getResponse, protyle, protyle.block.showAll ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS], saveScroll(protyle, true), true);
});
}
};

View file

@ -537,7 +537,7 @@ export const openSearch = async (hotkey: string, key?: string, notebookId?: stri
}
getAllModels().editor.forEach(item => {
if (rootIds[0] === item.editor.protyle.block.rootID) {
reloadProtyle(item.editor.protyle)
reloadProtyle(item.editor.protyle);
}
});
if (!currentList.nextElementSibling && searchPanelElement.children[0]) {

View file

@ -9,7 +9,7 @@ import {renderAssetsPreview} from "../asset/renderAssets";
import Protyle from "../protyle";
import {onGet} from "../protyle/util/onGet";
let historyEditor: Protyle
let historyEditor: Protyle;
const renderDoc = (element: HTMLElement, currentPage: number) => {
const previousElement = element.querySelector('[data-type="docprevious"]');
const nextElement = element.querySelector('[data-type="docnext"]');
@ -30,12 +30,12 @@ const renderDoc = (element: HTMLElement, currentPage: number) => {
docElement.classList.add("fn__none");
mdElement.classList.add("fn__none");
if (typeElement.value === "0") {
opElement.removeAttribute("disabled")
notebookElement.removeAttribute("disabled")
opElement.removeAttribute("disabled");
notebookElement.removeAttribute("disabled");
assetElement.classList.add("fn__none");
} else {
opElement.setAttribute("disabled", "disabled")
notebookElement.setAttribute("disabled", "disabled")
opElement.setAttribute("disabled", "disabled");
notebookElement.setAttribute("disabled", "disabled");
assetElement.classList.remove("fn__none");
}
fetchPost("/api/history/searchHistory", {
@ -84,11 +84,11 @@ const renderDoc = (element: HTMLElement, currentPage: number) => {
}, (contentResponse) => {
if (contentResponse.data.isLargeDoc) {
mdElement.value = contentResponse.data.content;
mdElement.classList.remove("fn__none")
docElement.classList.add("fn__none")
mdElement.classList.remove("fn__none");
docElement.classList.add("fn__none");
} else {
mdElement.classList.add("fn__none")
docElement.classList.remove("fn__none")
mdElement.classList.add("fn__none");
docElement.classList.remove("fn__none");
onGet(contentResponse, historyEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]);
}
});
@ -233,10 +233,10 @@ export const openHistory = () => {
}
const currentNotebookId = localStorage.getItem(Constants.LOCAL_HISTORYNOTEID);
let notebookSelectHTML = '';
let notebookSelectHTML = "";
window.siyuan.notebooks.forEach((item) => {
if (!item.closed) {
notebookSelectHTML += ` <option value="${item.id}"${item.id === currentNotebookId ? " selected" : ""}>${item.name}</option>`
notebookSelectHTML += ` <option value="${item.id}"${item.id === currentNotebookId ? " selected" : ""}>${item.name}</option>`;
}
});
const dialog = new Dialog({
@ -423,11 +423,11 @@ export const openHistory = () => {
}, (response) => {
if (response.data.isLargeDoc) {
mdElement.value = response.data.content;
mdElement.classList.remove("fn__none")
docElement.classList.add("fn__none")
mdElement.classList.remove("fn__none");
docElement.classList.add("fn__none");
} else {
mdElement.classList.add("fn__none")
docElement.classList.remove("fn__none")
mdElement.classList.add("fn__none");
docElement.classList.remove("fn__none");
onGet(response, historyEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]);
}
});