Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kernel API /api/block/foldBlock and /api/block/unfoldBlock #9962

Closed
LGRemdo opened this issue Dec 24, 2023 · 7 comments
Closed

Add kernel API /api/block/foldBlock and /api/block/unfoldBlock #9962

LGRemdo opened this issue Dec 24, 2023 · 7 comments
Assignees
Milestone

Comments

@LGRemdo
Copy link

LGRemdo commented Dec 24, 2023

[ Api申请] 块折叠

In what scenarios do you need this feature?

需要一个块的折叠与展开的api操作,这样我可以写外部的脚本,快速的折叠 / 展开普通块或者标题。
这样会带来很高的效率,但是感觉官方的开源代码太复杂了,没有能力解读与应用。希望提供支持

Describe the optimal solution

Describe the candidate solution

API支持传入指定的非文档块ID,即可折叠对应的块

Other information

No response

@88250 88250 self-assigned this Dec 24, 2023
@88250 88250 added this to the 2.11.4 milestone Dec 24, 2023
@88250 88250 changed the title [ Api申请] 块折叠 Add kernel API /api/block/foldBlock and /api/block/unfoldBlock Dec 24, 2023
@LGRemdo
Copy link
Author

LGRemdo commented Dec 24, 2023

我觉得databack可以返回块当前的折叠状态,方便有时候执行switch操作

@88250
Copy link
Member

88250 commented Dec 24, 2023

databack 是啥?

@LGRemdo
Copy link
Author

LGRemdo commented Dec 24, 2023

databack 是啥?

就是调用API的返回值

@88250
Copy link
Member

88250 commented Dec 24, 2023

调用 foldBlock 了的话就是折叠状态,调用 unfoldBlock 的话就是展开状态,应该不需要再判断了。

@LGRemdo
Copy link
Author

LGRemdo commented Dec 24, 2023

调用 foldBlock 了的话就是折叠状态,调用 unfoldBlock 的话就是展开状态,应该不需要再判断了。

有的时候需要到当前的状态才能做切换的动作。真的其实有必要的。在有的场景下是明确的知道哪些元素该关,哪些元素该开。

有的时候在特殊的场景下也需要做状态的切换呀。这个切换背后的后台数据又不是由用户把控的,所以说想要用户把控的话就给一个反馈信息呗~

@88250
Copy link
Member

88250 commented Dec 24, 2023

可以用 getBlockAttrs 获取块属性来判断折叠状态的。

@LGRemdo
Copy link
Author

LGRemdo commented Dec 25, 2023

可以用 getBlockAttrs 获取块属性来判断折叠状态的。

好哦~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants