Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/9254

Vanessaa21e72223fdb
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index ec9225bc35..1d885eefef 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1836,44 +1836,46 @@ export class WYSIWYG {
const embedItemElement = hasClosestByClassName(event.target, "protyle-wysiwyg__embed");
if (embedItemElement) {
const embedId = embedItemElement.getAttribute("data-id");
- /// #if MOBILE
- openMobileFileById(protyle.app, embedId, [Constants.CB_GET_ALL]);
- activeBlur();
- hideKeyboardToolbar();
- /// #else
- if (event.shiftKey) {
- openFileById({
- app: protyle.app,
- id: embedId,
- position: "bottom",
- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL],
- zoomIn: true
- });
- } else if (event.altKey) {
- openFileById({
- app: protyle.app,
- id: embedId,
- position: "right",
- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL],
- zoomIn: true
- });
- } else if (ctrlIsPressed) {
- openFileById({
- app: protyle.app,
- id: embedId,
- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL],
- keepCursor: true,
- zoomIn: true
- });
- } else if (!protyle.disabled) {
- window.siyuan.blockPanels.push(new BlockPanel({
- app: protyle.app,
- targetElement: embedItemElement,
- isBacklink: false,
- nodeIds: [embedId],
- }));
- }
- /// #endif
+ fetchPost("/api/block/checkBlockFold", {id: embedId}, (foldResponse) => {
+ /// #if MOBILE
+ openMobileFileById(protyle.app, embedId, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
+ activeBlur();
+ hideKeyboardToolbar();
+ /// #else
+ if (event.shiftKey) {
+ openFileById({
+ app: protyle.app,
+ id: embedId,
+ position: "bottom",
+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
+ zoomIn: foldResponse.data
+ });
+ } else if (event.altKey) {
+ openFileById({
+ app: protyle.app,
+ id: embedId,
+ position: "right",
+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
+ zoomIn: foldResponse.data
+ });
+ } else if (ctrlIsPressed) {
+ openFileById({
+ app: protyle.app,
+ id: embedId,
+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
+ zoomIn: foldResponse.data,
+ keepCursor: true,
+ });
+ } else if (!protyle.disabled) {
+ window.siyuan.blockPanels.push(new BlockPanel({
+ app: protyle.app,
+ targetElement: embedItemElement,
+ isBacklink: false,
+ nodeIds: [embedId],
+ }));
+ }
+ /// #endif
+ });
event.stopPropagation();
return;
}