mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-14 12:48:51 +01:00
This commit is contained in:
parent
d30ba8049c
commit
9f55cd125d
2 changed files with 10 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ import {Constants} from "../constants";
|
|||
import {genItemPanel} from "./index";
|
||||
import {keymap} from "./keymap";
|
||||
import {App} from "../index";
|
||||
import {isPhablet} from "../protyle/util/compatibility";
|
||||
|
||||
const getLang = (keys: string[]) => {
|
||||
const langArray: string[] = [];
|
||||
|
|
@ -106,9 +107,11 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
|
|||
"vacuumDataIndex", "vacuumDataIndexTip", "rebuildDataIndex", "rebuildDataIndexTip"]),
|
||||
];
|
||||
const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;
|
||||
/// #if !BROWSER
|
||||
inputElement.focus();
|
||||
/// #endif
|
||||
if (!isPhablet()) {
|
||||
inputElement.focus();
|
||||
} else {
|
||||
(document.activeElement as HTMLElement)?.blur();
|
||||
}
|
||||
const updateTab = () => {
|
||||
const indexList: number[] = [];
|
||||
const inputValue = inputElement.value;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ import {clipboard, ipcRenderer} from "electron";
|
|||
import {processSYLink} from "../../editor/openLink";
|
||||
/// #endif
|
||||
|
||||
export const isPhablet = () => {
|
||||
return /Android|webOS|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(navigator.userAgent) || isIPhone() || isIPad();
|
||||
};
|
||||
|
||||
export const encodeBase64 = (text: string): string => {
|
||||
if (typeof Buffer !== "undefined") {
|
||||
return Buffer.from(text, "utf8").toString("base64");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue