mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
📱 键盘收起
This commit is contained in:
@@ -257,6 +257,7 @@
|
||||
background: var(--b3-theme-background);
|
||||
z-index: 221;
|
||||
display: flex;
|
||||
border-top: 1px solid var(--b3-border-color);
|
||||
|
||||
button {
|
||||
background: transparent;
|
||||
|
||||
@@ -19,12 +19,17 @@ export const hideKeyboardToolbar = () => {
|
||||
|
||||
export const initKeyboardToolbar = () => {
|
||||
const toolbarElement = document.getElementById("keyboardToolbar");
|
||||
toolbarElement.addEventListener(getEventName(), (event) => {
|
||||
toolbarElement.addEventListener("click", (event) => {
|
||||
const target = event.target as HTMLElement;
|
||||
const buttonElement = hasClosestByMatchTag(target, "BUTTON");
|
||||
if (!buttonElement || !window.siyuan.mobileEditor) {
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.mobileEditor.protyle.disabled) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const type = buttonElement.getAttribute("data-type");
|
||||
const protyle = window.siyuan.mobileEditor.protyle;
|
||||
if (type === "undo") {
|
||||
@@ -75,8 +80,8 @@ export const initKeyboardToolbar = () => {
|
||||
range.collapse(false);
|
||||
range.insertNode(document.createTextNode(Constants.ZWSP));
|
||||
range.collapse(false);
|
||||
focusByRange(range);
|
||||
}
|
||||
focusByRange(range);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user