mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 04:18:48 +01:00
This commit is contained in:
parent
7ded2d4077
commit
53aacb8a77
8 changed files with 9 additions and 18 deletions
|
|
@ -33,7 +33,6 @@ import {initFileTree} from "../settings/fileTree";
|
|||
|
||||
export const popMenu = () => {
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
document.getElementById("menu").style.transform = "translateX(0px)";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -672,7 +672,6 @@ export const popSearch = (app: App, searchConfig?: any) => {
|
|||
}
|
||||
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
let includeChild = true;
|
||||
let enableIncludeChild = false;
|
||||
config.idPath.forEach(item => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ export const closePanel = () => {
|
|||
};
|
||||
|
||||
export const closeModel = () => {
|
||||
document.getElementById("model").style.transform = "";
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
document.getElementById("model").style.transform = "";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -138,7 +138,6 @@ export const initFramework = (app: App, isStart: boolean) => {
|
|||
});
|
||||
window.siyuan.mobile.docks.file = new MobileFiles(app);
|
||||
document.getElementById("toolbarFile").addEventListener("click", () => {
|
||||
hideKeyboardToolbar();
|
||||
activeBlur();
|
||||
sidebarElement.style.transform = "translateX(0px)";
|
||||
const type = sidebarElement.querySelector(".toolbar--border .toolbar__icon--active").getAttribute("data-type");
|
||||
|
|
|
|||
|
|
@ -36,18 +36,18 @@ export const renderTextMenu = (protyle: IProtyle, toolbarElement: Element) => {
|
|||
"var(--b3-font-color9)", "var(--b3-font-color10)", "var(--b3-font-color11)", "var(--b3-font-color12)",
|
||||
"var(--b3-font-color13)"].forEach((item, index) => {
|
||||
colorHTML += `<button class="keyboard__slash-item" data-type="color">
|
||||
<span class="keyboard__slash-icon" ${item?`style="color:${item}"`:""}>A</span>
|
||||
<span class="keyboard__slash-text">${window.siyuan.languages.colorFont} ${item?index + 1:window.siyuan.languages.default}</span>
|
||||
<span class="keyboard__slash-icon" ${item ? `style="color:${item}"` : ""}>A</span>
|
||||
<span class="keyboard__slash-text">${window.siyuan.languages.colorFont} ${item ? index + 1 : window.siyuan.languages.default}</span>
|
||||
</button>`;
|
||||
});
|
||||
let bgHTML = "";
|
||||
["","var(--b3-font-background1)", "var(--b3-font-background2)", "var(--b3-font-background3)", "var(--b3-font-background4)",
|
||||
["", "var(--b3-font-background1)", "var(--b3-font-background2)", "var(--b3-font-background3)", "var(--b3-font-background4)",
|
||||
"var(--b3-font-background5)", "var(--b3-font-background6)", "var(--b3-font-background7)", "var(--b3-font-background8)",
|
||||
"var(--b3-font-background9)", "var(--b3-font-background10)", "var(--b3-font-background11)", "var(--b3-font-background12)",
|
||||
"var(--b3-font-background13)"].forEach((item, index) => {
|
||||
bgHTML += `<button class="keyboard__slash-item" data-type="backgroundColor">
|
||||
<span class="keyboard__slash-icon" ${item?`style="background-color:${item}"`:""}>A</span>
|
||||
<span class="keyboard__slash-text">${window.siyuan.languages.colorPrimary} ${item?index + 1:window.siyuan.languages.default}</span>
|
||||
<span class="keyboard__slash-icon" ${item ? `style="background-color:${item}"` : ""}>A</span>
|
||||
<span class="keyboard__slash-text">${window.siyuan.languages.colorPrimary} ${item ? index + 1 : window.siyuan.languages.default}</span>
|
||||
</button>`;
|
||||
});
|
||||
|
||||
|
|
@ -462,6 +462,8 @@ export const hideKeyboardToolbar = () => {
|
|||
};
|
||||
|
||||
export const activeBlur = () => {
|
||||
window.JSAndroid?.hideKeyboard();
|
||||
hideKeyboardToolbar();
|
||||
(document.activeElement as HTMLElement).blur();
|
||||
};
|
||||
|
||||
|
|
@ -566,7 +568,6 @@ export const initKeyboardToolbar = () => {
|
|||
focusByRange(range);
|
||||
} else {
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -658,7 +659,6 @@ export const initKeyboardToolbar = () => {
|
|||
protyle.gutter.renderMenu(protyle, nodeElement);
|
||||
window.siyuan.menus.menu.fullscreen();
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
return;
|
||||
} else if (type === "outdent") {
|
||||
listOutdent(protyle, [nodeElement.parentElement], range);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ const popSide = (render = true) => {
|
|||
if (render) {
|
||||
document.getElementById("toolbarFile").dispatchEvent(new CustomEvent("click"));
|
||||
} else {
|
||||
hideKeyboardToolbar();
|
||||
activeBlur();
|
||||
document.getElementById("sidebar").style.transform = "translateX(0px)";
|
||||
}
|
||||
|
|
@ -309,7 +308,6 @@ export const handleTouchMove = (event: TouchEvent) => {
|
|||
transformMask((windowWidth - xDiff) / windowWidth);
|
||||
}
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
if (window.siyuan.mobile.editor) {
|
||||
window.siyuan.mobile.editor.protyle.contentElement.style.overflow = "hidden";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2168,7 +2168,6 @@ export class WYSIWYG {
|
|||
// https://github.com/siyuan-note/siyuan/issues/14569
|
||||
if (event.target.tagName === "VIDEO") {
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
return;
|
||||
}
|
||||
/// #endif
|
||||
|
|
@ -2265,7 +2264,6 @@ export class WYSIWYG {
|
|||
}
|
||||
/// #if MOBILE
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
/// #else
|
||||
if (event.shiftKey) {
|
||||
|
|
@ -2332,7 +2330,6 @@ export class WYSIWYG {
|
|||
}, (response) => {
|
||||
checkFold(response.data.refDefs[0].refID, (zoomIn) => {
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
openMobileFileById(protyle.app, response.data.refDefs[0].refID, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
});
|
||||
});
|
||||
|
|
@ -2406,7 +2403,6 @@ export class WYSIWYG {
|
|||
checkFold(embedId, (zoomIn, action) => {
|
||||
/// #if MOBILE
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
openMobileFileById(protyle.app, embedId, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
/// #else
|
||||
if (event.shiftKey) {
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -208,6 +208,7 @@ interface Window {
|
|||
readClipboard(): string
|
||||
readHTMLClipboard(): string
|
||||
getBlockURL(): string
|
||||
hideKeyboard(): void
|
||||
}
|
||||
JSHarmony: {
|
||||
openExternal(url: string): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue