From 5e21a23cb1f175a1f1685dd164b73dce7f612c70 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 20 Aug 2021 11:34:26 +0200 Subject: [PATCH] fix issue with filemanager modal and scroll --- assets/js/admin/modules/modal.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/js/admin/modules/modal.js b/assets/js/admin/modules/modal.js index 4cae714..8afb28a 100644 --- a/assets/js/admin/modules/modal.js +++ b/assets/js/admin/modules/modal.js @@ -25,8 +25,15 @@ const openModal = function (url) { module.exports = function () { let click = 0 + const body = $('body') - $('body').on('click', '*[data-modal]', (e) => { + body.on('hidden.bs.modal', '.modal', (e) => { + if ($('.modal.show').length) { + $('body').addClass('modal-open') + } + }) + + body.on('click', '*[data-modal]', (e) => { e.preventDefault() e.stopPropagation()