N°3469 - Portal: Fix modal created without an ID

This commit is contained in:
Molkobain
2020-12-02 16:59:13 +01:00
parent 35d77ff642
commit aa43425df3

View File

@@ -106,7 +106,11 @@ var CombodoPortalToolbox = {
if (oOptions.base_modal.usage === 'clone')
{
oModalElem = oSelectorElem.clone();
oModalElem.attr('id', oOptions.id)
// Force modal to have an HTML ID, otherwise it can lead to complications, especially with the portal_leave_handle.js
// See N°3469
let sModalID = (oOptions.id !== null) ? oOptions.id : 'modal-with-generated-id-'+Date.now();
oModalElem.attr('id', sModalID)
.appendTo('body');
}
// - Get an existing modal in the DOM