Issue #1619Opened November 29, 2018by ghost0 reactions

[Question] 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)

artfDecember 1, 20180 reactions

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, 20180 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.