This commit is contained in:
Vanessa 2023-04-06 22:32:33 +08:00
parent 0fe6759bde
commit 5987b0cea7
7 changed files with 21 additions and 21 deletions

View file

@ -365,7 +365,7 @@ export const globalShortcut = () => {
const currentType = currentLiElement.getAttribute("data-type");
if (currentType) {
if (currentType === "riffCard") {
openCard()
openCard();
} else {
getDockByType(currentType as TDockType).toggleModel(currentType as TDockType, true);
}
@ -931,7 +931,7 @@ const dialogArrow = (element: HTMLElement, event: KeyboardEvent) => {
const currentType = currentLiElement.getAttribute("data-type");
if (currentType) {
if (currentType === "riffCard") {
openCard()
openCard();
} else {
getDockByType(currentType as TDockType).toggleModel(currentType as TDockType, true);
}

View file

@ -12,8 +12,8 @@ export const openChangelog = () => {
const dialog = new Dialog({
title: `v${Constants.SIYUAN_VERSION} ${window.siyuan.languages.update}`,
width: isMobile() ? "80vw" : "520px",
content: `<div class="b3-dialog__content b3-typography b3-typography--default">${response.data.html}</div>`
content: `<div style="overflow:auto;height: ${isMobile() ? "80" : "70"}vh;" class="b3-dialog__content b3-typography b3-typography--default">${response.data.html}</div>`
});
highlightRender(dialog.element);
});
}
};

View file

@ -162,7 +162,7 @@ const showKeyboardToolbarUtil = (oldScrollTop: number) => {
};
const hideKeyboardToolbarUtil = () => {
const toolbarElement = document.getElementById("keyboardToolbar")
const toolbarElement = document.getElementById("keyboardToolbar");
toolbarElement.style.height = "";
window.siyuan.mobile.editor.protyle.element.style.marginBottom = "42px";
toolbarElement.querySelector('.keyboard__action[data-type="add"]').classList.remove("protyle-toolbar__item--current");

View file

@ -50,9 +50,9 @@ export const handleTouchEnd = (event: TouchEvent) => {
hasClosestByAttribute(target, "data-type", "NodeTable");
if (scrollElement) {
if (scrollElement.classList.contains("table")) {
scrollElement = scrollElement.firstElementChild as HTMLElement
scrollElement = scrollElement.firstElementChild as HTMLElement;
} else if (scrollElement.classList.contains("code-block")) {
scrollElement = scrollElement.firstElementChild.nextElementSibling as HTMLElement
scrollElement = scrollElement.firstElementChild.nextElementSibling as HTMLElement;
}
if ((xDiff <= 0 && scrollElement.scrollLeft > 0) ||
(xDiff >= 0 && scrollElement.clientWidth + scrollElement.scrollLeft < scrollElement.scrollWidth)) {
@ -196,9 +196,9 @@ export const handleTouchMove = (event: TouchEvent) => {
hasClosestByAttribute(target, "data-type", "NodeTable");
if (scrollElement) {
if (scrollElement.classList.contains("table")) {
scrollElement = scrollElement.firstElementChild as HTMLElement
scrollElement = scrollElement.firstElementChild as HTMLElement;
} else if (scrollElement.classList.contains("code-block")) {
scrollElement = scrollElement.firstElementChild.nextElementSibling as HTMLElement
scrollElement = scrollElement.firstElementChild.nextElementSibling as HTMLElement;
}
if ((xDiff < 0 && scrollElement.scrollLeft > 0) ||
(xDiff > 0 && scrollElement.clientWidth + scrollElement.scrollLeft < scrollElement.scrollWidth)) {

View file

@ -12,7 +12,7 @@ export const setEditMode = (protyle: IProtyle, type: TEditorMode) => {
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb?.element.classList.add("fn__none");
if (protyle.block.showAll) {
const exitFocusElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="exit-focus"]')
const exitFocusElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="exit-focus"]');
exitFocusElement.classList.add("fn__none");
exitFocusElement.nextElementSibling.classList.add("fn__none");
}
@ -32,7 +32,7 @@ export const setEditMode = (protyle: IProtyle, type: TEditorMode) => {
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb?.element.classList.remove("fn__none");
if (protyle.block.showAll) {
const exitFocusElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="exit-focus"]')
const exitFocusElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="exit-focus"]');
exitFocusElement.classList.remove("fn__none");
exitFocusElement.nextElementSibling.classList.remove("fn__none");
}

View file

@ -98,7 +98,7 @@ export const openGlobalSearch = (text: string, replace: boolean) => {
};
const newEmptyFileByInput = (value: string) => {
const newData = getNewFilePath(true)
const newData = getNewFilePath(true);
fetchPost("/api/filetree/getHPathByPath", {
notebook: newData.notebookId,
path: newData.currentPath,
@ -552,7 +552,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
replaceInputElement.value = target.textContent;
replaceHistoryElement.classList.add("fn__none");
} else if (target.getAttribute("data-type") === "search-new") {
newEmptyFileByInput(searchInputElement.value)
newEmptyFileByInput(searchInputElement.value);
} else if (target.getAttribute("data-type") === "search-item") {
if (event.detail === 1) {
clickTimeout = window.setTimeout(() => {
@ -635,7 +635,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
if (!currentList || event.isComposing) {
return;
}
const focusIsNew = currentList.getAttribute("data-type") === "search-new"
const focusIsNew = currentList.getAttribute("data-type") === "search-new";
if (focusIsNew && matchHotKey(window.siyuan.config.keymap.general.newFile.custom, event)) {
newEmptyFileByInput(searchInputElement.value);
event.preventDefault();
@ -644,7 +644,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
}
if (event.key === "Enter") {
if (focusIsNew) {
newEmptyFileByInput(searchInputElement.value)
newEmptyFileByInput(searchInputElement.value);
} else {
const id = currentList.getAttribute("data-node-id");
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
@ -1334,7 +1334,7 @@ const replace = (element: Element, config: ISearchOption, edit: Protyle, isAll:
if (currentList.nextElementSibling || currentList.previousElementSibling) {
currentList.remove();
} else {
const nextDocElement = currentList.parentElement.nextElementSibling || currentList.parentElement.previousElementSibling.previousElementSibling?.previousElementSibling
const nextDocElement = currentList.parentElement.nextElementSibling || currentList.parentElement.previousElementSibling.previousElementSibling?.previousElementSibling;
if (nextDocElement) {
nextDocElement.nextElementSibling.firstElementChild.classList.add("b3-list-item--focus");
nextDocElement.nextElementSibling.classList.remove("fn__none");

View file

@ -12,8 +12,8 @@ import {Constants} from "../constants";
import {validateName} from "../editor/rename";
export const getNewFilePath = (useSavePath: boolean) => {
let notebookId = ""
let currentPath = ""
let notebookId = "";
let currentPath = "";
/// #if !MOBILE
getAllModels().editor.find((item) => {
const currentElement = item.parent.headElement;
@ -57,8 +57,8 @@ export const getNewFilePath = (useSavePath: boolean) => {
}
});
}
return {notebookId, currentPath}
}
return {notebookId, currentPath};
};
export const newFile = (notebookId?: string, currentPath?: string, paths?: string[], useSavePath = false) => {
if (getOpenNotebookCount() === 0) {
@ -66,7 +66,7 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
return;
}
if (!notebookId) {
const resultData = getNewFilePath(useSavePath)
const resultData = getNewFilePath(useSavePath);
notebookId = resultData.notebookId;
currentPath = resultData.currentPath;
}