An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve the menu for inserting IFrame, audio, and video links on mobile https://github.com/siyuan-note/siyuan/issues/18665
Daniel21dbce06a75d
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.tsindex 266fd84a1e..5a2a160ebc 100644--- a/app/src/protyle/hint/index.ts+++ b/app/src/protyle/hint/index.ts@@ -1051,15 +1051,22 @@ ${genHintItemHTML(item)}highlightRender(nodeElement);} else if (value.startsWith("<iframe") || value.startsWith("<video") || value.startsWith("<audio")) {protyle.gutter.renderMenu(protyle, nodeElement);- const rect = nodeElement.getBoundingClientRect();- window.siyuan.menus.menu.popup({- x: rect.left,- y: rect.top,- isLeft: true- });const itemElement = window.siyuan.menus.menu.element.querySelector('[data-id="assetVideo"], [data-id="assetAudio"], [data-id="assetIFrame"]');- itemElement.classList.add("b3-menu__item--show");- window.siyuan.menus.menu.showSubMenu(itemElement.querySelector(".b3-menu__submenu"));+ if (isMobile()) {+ // 移动端将资源子菜单内容提升为底部菜单根内容。+ const subMenuItemsElement = itemElement.querySelector(":scope > .b3-menu__submenu > .b3-menu__items");+ window.siyuan.menus.menu.element.lastElementChild.replaceChildren(...Array.from(subMenuItemsElement.children));+ window.siyuan.menus.menu.fullscreen();+ } else {+ const rect = nodeElement.getBoundingClientRect();+ window.siyuan.menus.menu.popup({+ x: rect.left,+ y: rect.top,+ isLeft: true+ });+ itemElement.classList.add("b3-menu__item--show");+ window.siyuan.menus.menu.showSubMenu(itemElement.querySelector(".b3-menu__submenu"));+ }window.siyuan.menus.menu.element.querySelector("textarea").focus();} else if (value === "---") {focusBlock(nodeElement);