diff --git a/modules/system/assets/ui/js/popup.js b/modules/system/assets/ui/js/popup.js index a52454dc0b..bea65444b0 100644 --- a/modules/system/assets/ui/js/popup.js +++ b/modules/system/assets/ui/js/popup.js @@ -50,7 +50,8 @@ size: null, adaptiveHeight: false, zIndex: null, - cssClass: null + cssClass: null, + allowDismiss: false } Popup.prototype.init = function(){ @@ -213,6 +214,17 @@ if (this.options.zIndex !== null) modal.css('z-index', this.options.zIndex + 20) + + if (this.options.allowDismiss) { + modal.on('click', function(e) { + const target = e.target; + if (target.classList.contains('control-popup')) { + modal.hide() + $('.popup-backdrop').remove() + $(document.body).removeClass('modal-open') + } + }); + } return modal.append(modalDialog.append(modalContent)) }