DEV: applies default modal class to a modal when shown (#9175)

This commit is contained in:
Joffrey JAFFEUX 2020-03-11 15:31:08 +01:00 committed by GitHub
parent 4a0f36e46c
commit 1fca745beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,10 @@ export default function(name, opts) {
const route = container.lookup("route:application");
const modalController = route.controllerFor("modal");
modalController.set("modalClass", opts.modalClass);
modalController.set(
"modalClass",
opts.modalClass || `${dasherize(name).toLowerCase()}-modal`
);
const controllerName = opts.admin ? `modals/${name}` : name;
modalController.set("name", controllerName);