[Question] Update resizer after asset changed
Question
Hi! I trying to change default assets manager with ours custom manager.
editor.Commands.add('open-assets', {
run(editorImage,b,target) {
editorImage.getSelected().set('src', 'http://placehold.it/'+Math.floor((Math.random() * 800) + 400)+'x'+Math.floor((Math.random() * 400) + 200)+'/fff/000/testimage.jpg');
}
})
On double click the selected image is replaced with a new one with different size. It works, but the resizers element not updating their position. It is possibile to re-initialize it?

Thanks!
Answers (3)
I have an image on canvas, for example 300x200, double click on it and I select a new image from asset manager, now is 600x400. When i launch your suggested code the new image is not ready. I solved with a preloader,
In Italy we say: "I am lost in a glass of water" :)
Thanks for the support.
Try to reselect the component
var selected = editor.getSelected();
editor.select().select(selected);
Thanks for your reply, I tried your suggestion, but the image is not ready yet when I launch selection update. There are a callback or a listener on loaded image?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1457
[Question]: Custom asset manager background-image in Style Manager
Hello, i want to use custom Asset Manager i am used this solution, ` var assettarget =''; editor.Commands.add('open-assets', { run(editor,...
Issue #1241
[Question]: new style is not reflected in panel
Hello, In my project I have replaced the AssetManager by my own. However, when I use the new manager to update a components background-imag...
Issue #1578
[Question] Custom request on "src" attributes
I implemented a small GrapesJS editor that allows to edit Django/Jinja2 templates. GrapesJS by default is trying to GET the image preview o...
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...
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.