How to double-click another element in the canvas to open asset management #4426
Answered
by
artf
zhangdongxu-web
asked this question in
Q&A
|
Excuse me how to double-click the video element in the canvas to start asset management, just like the default double-click img element in grapesjs to open the asset manager. Thank you for your help I look forward to your help |
Answered by
artf
Jul 7, 2022
Replies: 1 comment 1 reply
|
Hi @zhangdongxu-web you can extend the Video component view by following the same behavior from the Image component. |
1 reply
Answer selected by
zhangdongxu-web
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @zhangdongxu-web you can extend the Video component view by following the same behavior from the Image component.
Here you bind the event
https://github.com/artf/grapesjs/blob/22fb44ba9934f87ce12f60fa2a7b37b6ec37835b/src/dom_components/view/ComponentImageView.js#L10
and then you add the onActive method
https://github.com/artf/grapesjs/blob/22fb44ba9934f87ce12f60fa2a7b37b6ec37835b/src/dom_components/view/ComponentImageView.js#L61-L77