Issue #1619💬 AnsweredOpened November 29, 2018by ghost0 reactions

Custom Modal Classes

快速解答by artf

You can do it by intercepting their commands

Read full answer below ↓

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)

artfDecember 1, 2018

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))
ghostDecember 1, 2018

Great, thanks @artf.

I will give it a go.

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.