Issue #930💬 AnsweredOpened March 7, 2018by alfaalex811 reactions

Update resizer after asset changed

Quick answerby alfaalex811

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.

Read full answer below ↓

Question

Hi! I trying to change default assets manager with ours custom manager. 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)

alfaalex81March 12, 2018

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.

artfMarch 8, 2018

Try to reselect the component

var selected = editor.getSelected();
editor.select().select(selected);
alfaalex81March 8, 2018

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.

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.