From abda42015b7c4acfcc12a929f5153e617b79aff9 Mon Sep 17 00:00:00 2001 From: camer0n Date: Tue, 7 Jan 2025 11:18:18 -0800 Subject: [PATCH] Closes #5379 - Adds support for custom styling of modal windows in admin area. --- e107_web/js/core/admin.jquery.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index 2bde18a40..61669ab1d 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -31,6 +31,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; var caption = $this.attr('data-modal-caption'); var height = ($(window).height() * 0.7) - 120; var target = $this.attr('data-modal-target'); + var customClass = $this.attr('data-modal-class'); if(caption === undefined) { @@ -47,6 +48,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; $(target+' .modal-footer button[data-dismiss="modal"]').hide(); } + if (customClass) + { + $(target + ' .modal-dialog').addClass(customClass); + } + $(target+' .modal-body').html('
'); $(target+' .modal-caption').html(caption + ' '); $(target+'.modal').modal('show'); @@ -88,7 +94,13 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; }); - + $(target).on('hidden.bs.modal', function () + { + if (customClass) + { + $(target + ' .modal-dialog').removeClass(customClass); + } + }); return false; });