Skip to content

Commit

Permalink
[add] allowDismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
AIC-BV authored Feb 23, 2024
1 parent 137b717 commit c296dbe
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/system/assets/ui/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
size: null,
adaptiveHeight: false,
zIndex: null,
cssClass: null
cssClass: null,
allowDismiss: false
}

Popup.prototype.init = function(){
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit c296dbe

Please sign in to comment.