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 plugin event bus loaded-protyle-dynamic #9021

Closed
WingDr opened this issue Aug 21, 2023 · 4 comments
Closed

Add plugin event bus loaded-protyle-dynamic #9021

WingDr opened this issue Aug 21, 2023 · 4 comments
Assignees
Milestone

Comments

@WingDr
Copy link

WingDr commented Aug 21, 2023

In what scenarios do you need this feature?

试了一下,目前ws-main里还没有动态加载触发的EventBus(ws-main里不会触发),目前的监听还在使用"DOMSubtreeModified"的eventlistener,很不方便(包括每次动态加载都会触发非常多次,然后取消监听也比较难受),希望能够加上这种情况的触发,每次加载完毕之后只触发一次就最好了

Describe the optimal solution

一个dynamic-load-complete(或者类似名字)的EventBus,在当前所有块(文档界面/动态加载的块)加载完毕之后触发,让我们能对加载后的界面进行操作,最好是返回一个触发所在的protyle

Describe the candidate solution

No response

Other information

No response

@zxhd863943427
Copy link
Contributor

赞同,没有动态加载的事件使得完全无法对文档本身下手。

@Vanessa219
Copy link
Member

动态加载指得是?如果是打开文档的加载完成可以监听 loaded-protyle

@Vanessa219 Vanessa219 removed their assignment Aug 23, 2023
@WingDr
Copy link
Author

WingDr commented Aug 23, 2023

动态加载指得是?如果是打开文档的加载完成可以监听 loaded-protyle

就是长文档在往下滚动之后不是会动态加载嘛,那个没办法触发load-protyle的,只能通过监听dom实现,但是动态加载的过程貌似是分批删除和插入节点,所以会触发非常多次。目前用MutationObserver监听,效果还好,但是还是希望有官方的eventbus触发

@WingDr
Copy link
Author

WingDr commented Aug 24, 2023

动态加载指得是?如果是打开文档的加载完成可以监听 loaded-protyle

好像用的词不是很准确?就是文档的懒加载

@Vanessa219 Vanessa219 changed the title 添加动态加载的EventBus Add plugin event bus loaded-protyle-dynamic Aug 24, 2023
@Vanessa219 Vanessa219 self-assigned this Aug 24, 2023
@Vanessa219 Vanessa219 added this to the 2.10.2 milestone Aug 24, 2023
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

3 participants