Issue #2358✓ SolvedOpened October 30, 2019by Uysim3 reactions

How to set callbacks when asset click

Quick answerby artf2

@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)

UysimOctober 30, 2019

@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

pouyamiralayiOctober 30, 2019

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.