mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-30 04:05:16 +01:00
This commit is contained in:
parent
7ded2d4077
commit
53aacb8a77
8 changed files with 9 additions and 18 deletions
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue