This commit is contained in:
Vanessa 2022-11-19 10:49:43 +08:00
parent 1f391d7f50
commit b542a80f56
8 changed files with 13 additions and 14 deletions

View file

@ -6,7 +6,6 @@ import {Constants} from "../constants";
import {exportLayout, resetLayout} from "../layout/util";
import {isBrowser} from "../util/functions";
import {fetchPost} from "../util/fetch";
import {loadAssets} from "../util/assets";
import {genOptions} from "../util/genOptions";
import {openSnippets} from "./util/snippets";
import {openColorPicker} from "./util/colorPicker";

View file

@ -200,7 +200,7 @@ const getUnInitTab = (options: IOpenFileOptions) => {
}
}
});
}
};
const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModels) => {
allModels.editor.forEach((item) => {

View file

@ -428,7 +428,7 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
export const resizeDrag = () => {
const dragElement = document.getElementById("drag");
const width = dragElement.clientWidth;
const dragRect = dragElement.getBoundingClientRect()
const dragRect = dragElement.getBoundingClientRect();
const left = dragRect.left;
const right = window.innerWidth - dragRect.right;
if (left > right && left - right < width) {

View file

@ -58,8 +58,8 @@ export const exportImage = (id: string) => {
}
});
previewElement.querySelectorAll(".li > .protyle-action > svg").forEach(item => {
const id = item.firstElementChild.getAttribute("xlink:href")
const symbolElements = document.querySelectorAll(id)
const id = item.firstElementChild.getAttribute("xlink:href");
const symbolElements = document.querySelectorAll(id);
let viewBox = "0 0 32 32";
if (id === "#iconDot") {
viewBox = "0 0 20 20";

View file

@ -3,7 +3,7 @@ import {getIconByType} from "../../editor/getIcon";
import {iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
import {MenuItem} from "../../menus/Menu";
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
import {isCtrl, updateHotkeyTip, writeText} from "../util/compatibility";
import {updateHotkeyTip, writeText} from "../util/compatibility";
import {
transaction,
turnsIntoOneTransaction, turnsIntoTransaction,

View file

@ -18,9 +18,9 @@ export const reloadProtyle = (protyle: IProtyle) => {
addLoading(protyle);
if (protyle.options.backlinkData) {
const isMention = protyle.element.getAttribute("data-ismention") === "true";
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink")
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
if (tabElement) {
const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>
const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>;
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
defID: protyle.element.getAttribute("data-defid"),
refTreeID: protyle.block.rootID,

View file

@ -361,8 +361,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (previousElement) {
previousElement.setAttribute("select-end", "true");
if (previousElement.getBoundingClientRect().top <= protyle.contentElement.getBoundingClientRect().top) {
preventScroll(protyle)
previousElement.scrollIntoView(true)
preventScroll(protyle);
previousElement.scrollIntoView(true);
}
}
}
@ -398,8 +398,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (nextElement) {
nextElement.setAttribute("select-end", "true");
if (nextElement.getBoundingClientRect().bottom >= protyle.contentElement.getBoundingClientRect().bottom) {
preventScroll(protyle)
nextElement.scrollIntoView(false)
preventScroll(protyle);
nextElement.scrollIntoView(false);
}
}
}

View file

@ -251,7 +251,7 @@ const watchTheme = (data: { init: boolean, OSTheme: string }) => {
if ((window.siyuan.config.system.container === "ios" && window.webkit?.messageHandlers) ||
(window.siyuan.config.system.container === "android" && window.JSAndroid)) {
setTimeout(() => {
const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background")
const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background");
let mode = window.siyuan.config.appearance.mode;
if (window.siyuan.config.appearance.modeOS) {
if (data.OSTheme === "dark") {
@ -304,4 +304,4 @@ const watchTheme = (data: { init: boolean, OSTheme: string }) => {
window.siyuan.config.appearance = response.data.appearance;
loadAssets(response.data.appearance);
});
}
};