How to set callbacks when asset click
@Uysim you can extend the image type https://grapesjs.com/docs/modules/Assets.html#extend-asset-types Here is the original view of the image type
Read full answer below ↓Question
I can see that image has been set only with a single click on image asset. I want to close the modal even on when click. I try to set a callback on asset click
editor.AssetManager.onClick((model)=>{
console.log('model');
})
But when I click on asset. The console never trigger.
Answers (3)
@Uysim you can extend the image type https://grapesjs.com/docs/modules/Assets.html#extend-asset-types
Here is the original view of the image type
@pouyamiralayi This is not correct. My question is about the callback when user click on image on assets manager.
Your answer mean to close the modal immediately after it is opened
Hi there! your answer is hereI want to close the modal even on when click. try to set a callback on asset click cheers!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1044
change src for image element in model
hello when a image block drop to editor i hide the default asset manager and display my custom asset manager: fot this i have no problem.bu...
Issue #3376
Changing upload URL for AssetManager programmatically
I've got an situation where depending on how the Asset Manager is opened I want to pass a slightly different upload URL. In the asset:uploa...
Issue #3415
Custom Asset Manager. How to set bg image
Hi there! I'm building a custom modal for the Asset Manager and basically, it seems that I need to override command. How I can understand i...
Issue #2754
How can i customize video blocks a
I want to create a video gallery-like image gallery. After drop video block shows the gallery . How can I do that?I using grapesjs-preset-w...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.