Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:iphone:

Vanessab399473b18e7
diff --git a/app/src/assets/scss/component/_menu.scss b/app/src/assets/scss/component/_menu.scss
index 01c263b8cb..821edfdc48 100644
--- a/app/src/assets/scss/component/_menu.scss
+++ b/app/src/assets/scss/component/_menu.scss
@@ -25,7 +25,7 @@
max-height: none;
.b3-menu__submenu {
- top: 54px;
+ top: 45px;
left: 0;
bottom: 0;
max-height: none;
@@ -54,16 +54,7 @@
&__title {
padding: 8px;
- line-height: 30px;
- font-size: 18px;
- color: var(--b3-theme-on-surface);
- text-align: center;
-
- svg {
- height: 30px;
- width: 20px;
- float: left;
- }
+ display: flex;
}
&__item {
diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts
index 14a9a09cb7..a795f94e1b 100644
--- a/app/src/menus/Menu.ts
+++ b/app/src/menus/Menu.ts
@@ -92,7 +92,7 @@ export class Menu {
this.element.innerHTML = "";
this.element.classList.add("fn__none");
- this.element.classList.remove("b3-menu--list");
+ this.element.classList.remove("b3-menu--list", "b3-menu--fullscreen");
this.element.removeAttribute("style"); // zIndex
window.siyuan.menus.menu.element.removeAttribute("data-name"); // 标识再次点击不消失
}
@@ -121,8 +121,8 @@ export class Menu {
public fullscreen () {
this.element.classList.add("b3-menu--fullscreen");
this.element.insertAdjacentHTML("afterbegin", `<div class="b3-menu__title">
-<svg><use xlink:href="#iconLeft"></use></svg>
-${window.siyuan.languages.back}
+<svg class="b3-menu__icon"><use xlink:href="#iconLeft"></use></svg>
+<span class="b3-menu__label">${window.siyuan.languages.back}</span>
</div>`);
this.popup({x: 0, y: 0});
}
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 36c1e778c1..869d452587 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -15,12 +15,6 @@ const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
const utilElement = toolbarElement.querySelector(".keyboard__util") as HTMLElement
utilElement.innerHTML = protyle.hint.getHTMLByData(hintSlash("", protyle), false)
protyle.hint.bindUploadEvent(protyle, utilElement);
- utilElement.addEventListener("click", (event) => {
- const btnElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item");
- if (btnElement) {
- protyle.hint.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle);
- }
- })
}
const renderKeyboardToolbarUtil = () => {
@@ -186,6 +180,14 @@ export const initKeyboardToolbar = () => {
<div class="keyboard__util"></div>`;
toolbarElement.addEventListener("click", (event) => {
const target = event.target as HTMLElement;
+ const slashBtnElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item");
+ const protyle = window.siyuan.mobile.editor.protyle;
+ if (slashBtnElement) {
+ protyle.hint.fill(decodeURIComponent(slashBtnElement.getAttribute("data-value")), protyle);
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
const buttonElement = hasClosestByMatchTag(target, "BUTTON");
if (!buttonElement || buttonElement.getAttribute("disabled")) {
return;
@@ -201,7 +203,6 @@ export const initKeyboardToolbar = () => {
if (window.siyuan.config.readonly || window.siyuan.config.editor.readOnly || !window.siyuan.mobile.editor) {
return;
}
- const protyle = window.siyuan.mobile.editor.protyle;
if (type === "undo") {
protyle.undo.undo(protyle);
return;
@@ -227,6 +228,7 @@ export const initKeyboardToolbar = () => {
const dynamicElements = document.querySelectorAll("#keyboardToolbar .keyboard__dynamic");
dynamicElements[0].classList.remove("fn__none");
dynamicElements[1].classList.add("fn__none");
+ range.collapse(true);
focusByRange(range);
return;
} else if (["a", "block-ref", "inline-math", "inline-memo", "text"].includes(type)) {
@@ -256,12 +258,12 @@ export const initKeyboardToolbar = () => {
x: 0,
y: 0
});
- hideKeyboardToolbar();
+ activeBlur();
return;
} else if (type === "block") {
protyle.gutter.renderMenu(protyle, nodeElement);
- window.siyuan.menus.menu.popup({x: 0, y: 0}, true);
- hideKeyboardToolbar();
+ window.siyuan.menus.menu.fullscreen();
+ activeBlur();
return;
} else if (type === "outdent") {
listOutdent(protyle, [nodeElement.parentElement], range);