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 disable, enable method to Protyle #13391

Closed
Achuan-2 opened this issue Dec 7, 2024 · 6 comments
Closed

Add disable, enable method to Protyle #13391

Achuan-2 opened this issue Dec 7, 2024 · 6 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 7, 2024

In what scenarios do you need this feature?

思源如果开启全局只读模式,尽管当前文档已经解锁了,插件使用new Protyle,根据当前文档的块创建一个编辑弹窗,默认也是只读模式。
但我插件的使用场景是,调用插件的时候,用户是需要将当前文档解锁,但目前文档解锁了,插件的弹窗,却还要再解锁一次,有点不方便,目前我只能通过Protyle的面包屑解锁编辑,请问该如何自动解锁呢?看了Protyle的参数,并没有找到对应参数,调用protyle.protyle.disable =false. 也不起作用

Describe the optimal solution

Describe the candidate solution

Other information

No response

@Vanessa219
Copy link
Member

初始化的时候使用这个参数试试

image

@Achuan-2
Copy link
Member Author

Achuan-2 commented Dec 7, 2024

PixPin_2024-12-07_10-51-13
没有用

PixPin_2024-12-07_10-52-05

@Vanessa219
Copy link
Member

做为参数进行设置,不要赋值

@Achuan-2
Copy link
Member Author

Achuan-2 commented Dec 8, 2024

做为参数进行设置,不要赋值

不知道怎么传参,v姐能不能指导下

@Vanessa219 Vanessa219 changed the title 插件开发求助: 在只读模式下,使用new Protyle,有没有办法自动解锁,允许编辑 Add disable, enable method to Protyle Dec 9, 2024
@Vanessa219 Vanessa219 self-assigned this Dec 9, 2024
@Vanessa219 Vanessa219 added this to the 3.1.15 milestone Dec 9, 2024
Vanessa219 added a commit that referenced this issue Dec 9, 2024
@Vanessa219
Copy link
Member

不好意思,看错了,我加两个方法吧。

Vanessa219 added a commit to siyuan-note/petal that referenced this issue Dec 9, 2024
@Achuan-2
Copy link
Member Author

Achuan-2 commented Dec 9, 2024

好的,感谢V姐🙏

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