Custom Modal Classes
Question
Hi there,
Great app, much appreciated that you have put this out there for the community.
Just a quick question, I would like to modify the size and appearance of the different modals, ie. Export, Image upload etc.
But it seems there is no unique class/ID on any of the modals.
Is there an easy way to add a unique class based on the modal type?
I would like to add it specifically to the "gjs-mdl-dialog" element.
Thanks!
Answers (2)
You can do it by intercepting their commands
const getDialog = () => document.querySelector('.gjs-mdl-dialog');
const assetsCls = 'gjs-mdl-dialog--assets';
editor.on('run:open-assets', () => getDialog().classList.add(assetsCls))
editor.on('stop:open-assets', () => getDialog().classList.remove(assetsCls))
Great, thanks @artf.
I will give it a go.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3415
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 #923
[Question]: Add a select-option to toolbar
I have read the code and only I could find out that there is only a list of ToolbarButton associated with the toolbar. I have a special tra...
Issue #1144
[Question]: Custom property to change multiple settings
Is there a way to extend a current property or create a new one to change multiple properties? I have a component in which I would like to...
Issue #3367
Modal template
Is there a way for me to modify the template from a compiled state? https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0b...
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.