Skip to content

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

:art: Keep notebook change icon action on mobile only https://github.com/siyuan-note/siyuan/issues/18417

Daniel1bacc17c466a
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index 84c1293cf1..77374e5cb8 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -35,7 +35,9 @@ import {emitOpenMenu} from "../plugin/EventBus";
import {saveExportFile} from "../protyle/util/compatibility";
import {exportMarkdownZip} from "../protyle/export/exportMd";
import {addFilesToDatabase} from "../protyle/render/av/addToDatabase";
+/// #if MOBILE
import {openEmojiPanel} from "../emoji";
+/// #endif
const confirmEncryptedExport = (notebookId: string, callback: () => void) => {
if (!isEncryptedBox(notebookId)) {
@@ -242,31 +244,26 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
}
/// #endif
if (!window.siyuan.config.readonly) {
- let showChangeIcon = true;
- /// #if !MOBILE
- showChangeIcon = window.siyuan.config.fileTree.docIconClickExpand &&
- !window.siyuan.config.fileTree.boxDocEnabled;
- /// #endif
- if (showChangeIcon) {
- window.siyuan.menus.menu.append(new MenuItem({
- id: "changeIcon",
- label: window.siyuan.languages.changeIcon,
- icon: "iconEmoji",
- click: () => {
- const iconElement = liElement.querySelector<HTMLElement>(".b3-list-item__icon");
- if (!iconElement) {
- return;
- }
- const rect = iconElement.getBoundingClientRect();
- openEmojiPanel(notebookId, "notebook", {
- x: rect.left,
- y: rect.bottom,
- h: rect.height,
- w: rect.width,
- }, undefined, iconElement.querySelector<HTMLElement>("img"));
+ /// #if MOBILE
+ window.siyuan.menus.menu.append(new MenuItem({
+ id: "changeIcon",
+ label: window.siyuan.languages.changeIcon,
+ icon: "iconEmoji",
+ click: () => {
+ const iconElement = liElement.querySelector<HTMLElement>(".b3-list-item__icon");
+ if (!iconElement) {
+ return;
}
- }).element);
- }
+ const rect = iconElement.getBoundingClientRect();
+ openEmojiPanel(notebookId, "notebook", {
+ x: rect.left,
+ y: rect.bottom,
+ h: rect.height,
+ w: rect.width,
+ }, undefined, iconElement.querySelector<HTMLElement>("img"));
+ }
+ }).element);
+ /// #endif
window.siyuan.menus.menu.append(renameMenu({
path: "/",
notebookId,