Issue #2723Opened April 20, 2020by lewishealey0 reactions

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)

lewishealeyApril 20, 20200 reactions
Code SnippetTEXT
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.

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.