N°5888 - Correctly handle size option for modals

This commit is contained in:
Molkobain
2023-04-19 20:16:25 +02:00
parent 5aaaaec829
commit b078c0d289
2 changed files with 8 additions and 7 deletions

View File

@@ -109,14 +109,15 @@ CombodoModal._InstantiateModal = function(oModalElem, oOptions) {
// Resize to desired size
switch (typeof oOptions.size) {
case 'string':
oModalElem.find('.modal-dialog')
.removeClass('modal-lg')
.addClass('modal-' + oOptions.size);
if(oOptions.size !== undefined && oOptions.size !== 'auto') {
oModalElem.find('.modal-dialog')
.removeClass('modal-lg')
.addClass('modal-'+oOptions.size);
}
break;
case 'object':
CombodoJSConsole.Error('Could not open modal dialog as portal modals only support "xs", "sm", "md", "lg" sizes. Not specific width/height yet.');
return false;
CombodoJSConsole.Warn('Specifying a specific width / height on a modal dialog is not supported yet in the portal. Only "xs", "sm", "md", "lg" sizes are supported.');
}
// Load content