Custom asset manager background-image in Style Manager
@Stejsi inside opts you have onSelect callback which should update stuff in Style Manager. Unfortunately, it only accepts asset (object) as the argument (my bad, I'll make it also understand strings) so, for now you have to do this
Read full answer below ↓Question
Hello, i want to use custom Asset Manager i am used this solution, ` var assettarget =''; editor.Commands.add('open-assets', { run(editor, sender, opts = {}) { const modal = editor.Modal; const styleManager = editor.styleManager; assettarget = opts.target; modal.setTitle('Add new image'); var $test = $("<iframe style='width: 100%; height: calc(100vh - 60px);' src='http://192.168.0.227:45678/weby/fb/filemanager/dialog.php?editor=tinymce&type=1&lang=cs&popup=0&crossdomain=0&relative_url=0&akey=key&fldr=%2F&5ba947c59de97'>test</iframe>"); $test.on("load", function () { var iframe = $(this).conte...
Answers (2)
@Stejsi inside opts you have onSelect callback which should update stuff in Style Manager. Unfortunately, it only accepts asset (object) as the argument (my bad, I'll make it also understand strings) so, for now you have to do this
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
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 #930
[Question] Update resizer after asset changed
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...
Issue #1881
Commands with a stop method, never programmatically stoped don`t run again!
Problem When you add a custom command with stop and dont stop will not run again if I dont set force: 1 as a parameter when running. When y...
Issue #1831
[Question] How to run command for a block component?
I'd like to do something like this. so once a user drops the test component into the canvas, I'd like to open up asset manager modal where...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.