fix modal hiding when a file is successfuly uploaded in the file manager on tinymce

This commit is contained in:
Simon Vieille 2023-08-16 10:08:02 +02:00
parent 290a4750bc
commit 03c0d6cfd2
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -36,7 +36,7 @@ const fileManagerBrowser = function (callback) {
const clickCallback = (e) => {
callback($(e.target).attr('data-value'), {})
$('div[id^="modal-container"]').modal('hide')
$('div[id^="modal-container-"]').modal('hide')
container.modal('hide')
$('body').off('click', '#file-manager-insert', clickCallback)
@ -624,9 +624,11 @@ module.exports = function () {
doInitEditor()
$('body').on('hidden.bs.modal', '.modal', (e) => {
$(e.target).find('.tox-tinymce').each(() => {
window.tinymce.remove($(this).prev().attr('id'))
})
if (!$('.tox-dialog').length) {
$(e.target).find('.tox-tinymce').each(() => {
window.tinymce.remove($(this).prev().attr('id'))
})
}
})
})
}