mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
📱 编辑数据库单元格
This commit is contained in:
parent
ed1005af29
commit
05e660d5f6
4 changed files with 17 additions and 16 deletions
|
|
@ -37,6 +37,7 @@ import {correctHotkey} from "../boot/globalEvent/commonHotkey";
|
|||
import {processIOSPurchaseResponse} from "../util/iOSPurchase";
|
||||
import {updateControlAlt} from "../protyle/util/hotKey";
|
||||
import {nbsp2space} from "../protyle/util/normalizeText";
|
||||
import {callMobileAppShowKeyboard} from "./util/mobileAppUtil";
|
||||
|
||||
class App {
|
||||
public plugins: import("../plugin").Plugin[] = [];
|
||||
|
|
@ -105,11 +106,7 @@ class App {
|
|||
editElement = hasClosestByAttribute(event.target, "contenteditable", "true") as HTMLElement;
|
||||
}
|
||||
if (editElement) {
|
||||
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
callMobileAppShowKeyboard();
|
||||
}
|
||||
});
|
||||
window.addEventListener("beforeunload", () => {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import {hideElements} from "../../protyle/ui/hideElements";
|
|||
import {softEnter} from "../../protyle/wysiwyg/enter";
|
||||
import {isInAndroid, isInHarmony} from "../../protyle/util/compatibility";
|
||||
import {tabCodeBlock} from "../../protyle/wysiwyg/codeBlock";
|
||||
import {callMobileAppShowKeyboard} from "./mobileAppUtil";
|
||||
|
||||
let renderKeyboardToolbarTimeout: number;
|
||||
let showUtil = false;
|
||||
|
|
@ -609,11 +610,7 @@ export const initKeyboardToolbar = () => {
|
|||
if (type === "done") {
|
||||
if (toolbarElement.clientHeight > 100) {
|
||||
hideKeyboardToolbarUtil();
|
||||
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
callMobileAppShowKeyboard();
|
||||
setTimeout(() => focusByRange(range), 256);
|
||||
} else {
|
||||
activeBlur();
|
||||
|
|
@ -696,11 +693,7 @@ export const initKeyboardToolbar = () => {
|
|||
} else if (type === "add") {
|
||||
if (buttonElement.classList.contains("protyle-toolbar__item--current")) {
|
||||
hideKeyboardToolbarUtil();
|
||||
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
callMobileAppShowKeyboard();
|
||||
setTimeout(() => focusByRange(range), 256);
|
||||
} else {
|
||||
(document.activeElement as HTMLElement)?.blur();
|
||||
|
|
|
|||
7
app/src/mobile/util/mobileAppUtil.ts
Normal file
7
app/src/mobile/util/mobileAppUtil.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export const callMobileAppShowKeyboard = () => {
|
||||
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
};
|
||||
|
|
@ -38,6 +38,7 @@ import {escapeHtml} from "../../../util/escape";
|
|||
import {editGalleryItem, openGalleryItemMenu} from "./gallery/util";
|
||||
import {clearSelect} from "../../util/clear";
|
||||
import {removeCompressURL} from "../../../util/image";
|
||||
import {callMobileAppShowKeyboard} from "../../../mobile/util/mobileAppUtil";
|
||||
|
||||
let foldTimeout: number;
|
||||
export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => {
|
||||
|
|
@ -327,7 +328,10 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
if (viewsElement) {
|
||||
viewsElement.classList.add("av__views--show");
|
||||
}
|
||||
searchElement.focus();
|
||||
callMobileAppShowKeyboard();
|
||||
setTimeout(() => {
|
||||
searchElement.focus();
|
||||
}, Constants.TIMEOUT_TRANSITION);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue