mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-24 17:26:10 +01:00
This commit is contained in:
parent
83318d6246
commit
614e43ad24
2 changed files with 31 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ import {unicode2Emoji} from "../../emoji";
|
|||
import {newFileByName} from "../../util/newFile";
|
||||
import {showMessage} from "../../dialog/message";
|
||||
import {reloadProtyle} from "../../protyle/util/reload";
|
||||
import {activeBlur, hideKeyboardToolbar} from "../util/keyboardToolbar";
|
||||
|
||||
const replace = (element: Element, config: ISearchOption, isAll: boolean) => {
|
||||
if (config.method === 1 || config.method === 2) {
|
||||
|
|
@ -215,6 +216,9 @@ const updateSearchResult = (config: ISearchOption, element: Element) => {
|
|||
nextElement.setAttribute("disabled", "true");
|
||||
});
|
||||
} else {
|
||||
if (!config.page) {
|
||||
config.page = 1
|
||||
}
|
||||
if (config.page > 1) {
|
||||
previousElement.removeAttribute("disabled");
|
||||
} else {
|
||||
|
|
@ -514,6 +518,8 @@ const initSearchEvent = (element: Element, config: ISearchOption) => {
|
|||
};
|
||||
|
||||
export const popSearch = (config = window.siyuan.storage[Constants.LOCAL_SEARCHDATA] as ISearchOption) => {
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
let includeChild = true;
|
||||
let enableIncludeChild = false;
|
||||
config.idPath.forEach(item => {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {closePanel} from "./closePanel";
|
|||
import {popMenu} from "../menu";
|
||||
import {activeBlur, hideKeyboardToolbar} from "./keyboardToolbar";
|
||||
import {getCurrentEditor} from "../editor";
|
||||
import {linkMenu, refMenu, tagMenu} from "../../menus/protyle";
|
||||
|
||||
let clientX: number;
|
||||
let clientY: number;
|
||||
|
|
@ -23,14 +24,36 @@ const popSide = (render = true) => {
|
|||
};
|
||||
|
||||
export const handleTouchEnd = (event: TouchEvent) => {
|
||||
if (getCurrentEditor()) {
|
||||
const editor = getCurrentEditor()
|
||||
if (editor) {
|
||||
document.querySelectorAll(".protyle-breadcrumb__bar--hide").forEach(item => {
|
||||
item.classList.remove("protyle-breadcrumb__bar--hide");
|
||||
});
|
||||
window.siyuan.hideBreadcrumb = false;
|
||||
}
|
||||
|
||||
const target = event.target as HTMLElement;
|
||||
if (editor && typeof yDiff === "undefined" && new Date().getTime() - time > 900 &&
|
||||
target.tagName === "SPAN" && window.webkit?.messageHandlers &&
|
||||
!hasClosestByAttribute(target, "data-type", "NodeBlockQueryEmbed")) {
|
||||
// ios 长按行内元素弹出菜单
|
||||
const types = target.getAttribute("data-type").split(" ")
|
||||
if (types.includes("inline-memo")) {
|
||||
editor.protyle.toolbar.showRender(editor.protyle, target);
|
||||
}
|
||||
if (editor.protyle.disabled) {
|
||||
return;
|
||||
}
|
||||
if (types.includes("block-ref")) {
|
||||
refMenu(editor.protyle, target);
|
||||
} else if (types.includes("file-annotation-ref")) {
|
||||
editor.protyle.toolbar.showFileAnnotationRef(editor.protyle, target);
|
||||
} else if (types.includes("tag")) {
|
||||
tagMenu(editor.protyle, target);
|
||||
} else if (types.includes("a")) {
|
||||
linkMenu(editor.protyle, target);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!clientX || !clientY || typeof yDiff === "undefined" ||
|
||||
target.tagName === "AUDIO" ||
|
||||
hasClosestByClassName(target, "b3-dialog", true) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue