Issue #2358Opened October 30, 2019by Uysim3 reactions

[QUESTIONS] How to set callbacks when asset click

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, 20191 reactions

@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, 20190 reactions

Hi there! your answer is here

I want to close the modal even on when click.

editor.on('run:open-assets', () => editor.Modal.close())

try to set a callback on asset click

editor.on('run:open-assets', () => console.log('callback!'))

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.