mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
This commit is contained in:
parent
23bd4bed95
commit
65ab0c1123
2 changed files with 12 additions and 4 deletions
|
|
@ -27,13 +27,22 @@ const popSide = (render = true) => {
|
|||
};
|
||||
|
||||
export const handleTouchEnd = (event: TouchEvent, app: App) => {
|
||||
const target = event.target as HTMLElement;
|
||||
console.log(event.target);
|
||||
const wysisygElement = hasClosestByClassName(target, "protyle-wysiwyg", true);
|
||||
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" ||
|
||||
(wysisygElement && wysisygElement.getAttribute("data-readonly") === "false")) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else {
|
||||
window.JSAndroid.hideKeyboard();
|
||||
}
|
||||
|
||||
if (isIPhone() && globalTouchEnd(event, yDiff, time, app)) {
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
isFirstMove = true;
|
||||
const target = event.target as HTMLElement;
|
||||
if (!clientY || typeof yDiff === "undefined" ||
|
||||
target.tagName === "AUDIO" ||
|
||||
hasClosestByClassName(target, "b3-dialog", true) ||
|
||||
|
|
@ -67,8 +76,7 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
|
|||
const isXScroll = Math.abs(xDiff) > Math.abs(yDiff);
|
||||
const modelElement = hasClosestByAttribute(target, "id", "model", true);
|
||||
if (modelElement) {
|
||||
if (isXScroll && firstDirection === "toRight" && !lastClientX &&
|
||||
!hasClosestByClassName(target, "protyle-wysiwyg", true)) {
|
||||
if (isXScroll && firstDirection === "toRight" && !lastClientX && !wysisygElement) {
|
||||
closeModel();
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -235,7 +235,6 @@ interface Window {
|
|||
toCanvas: (element: Element) => Promise<HTMLCanvasElement>
|
||||
toBlob: (element: Element) => Promise<Blob>
|
||||
};
|
||||
|
||||
siyuan: ISiyuan;
|
||||
JSAndroid: {
|
||||
returnDesktop(): void
|
||||
|
|
@ -249,6 +248,7 @@ interface Window {
|
|||
readHTMLClipboard(): string
|
||||
getBlockURL(): string
|
||||
hideKeyboard(): void
|
||||
showKeyboard(): void
|
||||
print(title: string, html: string): void
|
||||
getScreenWidthPx(): number
|
||||
exit(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue