Event listening for loaded asset
Question
I need to find a way to expose the event listener when an image has been selected in the Asset Manager, is there a way to do it? I can only see event listeners when the image is uploaded, not selecting a pre-defined asset.
Thanks
Answers (1)
I got it with update target
`updateTarget(trgt) {
const image = this.model;
const dirName = image.attributes.src;
const filename = dirName.replace('https://d3d4x44eptevwm.cloudfront.net/md/','');
trgt.set('attributes', {
src: `https://d3d4x44eptevwm.cloudfront.net/md/${filename}`,
srcSet: `https://d3d4x44eptevwm.cloudfront.net/sm/${filename} 350w, https://d3d4x44eptevwm.cloudfront.net/md/${filename} 700w, https://d3d4x44eptevwm.cloudfront.net/lg/${filename} 1280w, https://d3d4x44eptevwm.cloudfront.net/xl/${filename} 1800w, https://d3d4x44eptevwm.cloudfront.net/xxl/${filename} 2400w`,
sizes: sizes
});
editor.Modal.close();
},`Related Questions and Answers
Continue research with similar issue discussions.
Issue #2516
Asset manager alert
Hi, thanks for the wonderful editor, I Tried to integrate the editor and everything is Fine. When the user selects an image from the asset...
Issue #2408
Event listener for undo?
I am listening for a component delete and move with removed() and sorter:drag:end. One last way (I hope) that I see the component move is b...
Issue #3415
QUESTION: 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 #1462
Uploaded image error
We have gotten GrapesJs integrated into our Angular application. We have the asset manager showing a list of images that have been uploaded...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.