From 1fca745beb29ec2392a87c65e6acf098b3d8ea68 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 11 Mar 2020 15:31:08 +0100 Subject: [PATCH] DEV: applies default modal class to a modal when shown (#9175) --- app/assets/javascripts/discourse/lib/show-modal.js.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/show-modal.js.es6 b/app/assets/javascripts/discourse/lib/show-modal.js.es6 index 968f1e399d4..18e6e8698f1 100644 --- a/app/assets/javascripts/discourse/lib/show-modal.js.es6 +++ b/app/assets/javascripts/discourse/lib/show-modal.js.es6 @@ -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);