mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°5888 - Correctly handle size option for modals
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -208,7 +208,7 @@ CombodoModal._InstantiateModal = function(oModalElem, oOptions) {
|
||||
buttons: this._ConvertButtonDefinition(oOptions.buttons)
|
||||
};
|
||||
|
||||
let aSizeMap = {
|
||||
const aSizeMap = {
|
||||
'xs': 'extra-small',
|
||||
's': 'small',
|
||||
'md': 'medium',
|
||||
@@ -218,7 +218,7 @@ CombodoModal._InstantiateModal = function(oModalElem, oOptions) {
|
||||
// Resize to desired size
|
||||
switch (typeof oOptions.size) {
|
||||
case 'string':
|
||||
if(aSizeMap[oOptions.size] !== undefined) {
|
||||
if(aSizeMap[oOptions.size] !== undefined && aSizeMap[oOptions.size] !== 'auto') {
|
||||
let sSize = 'ibo-is-' + aSizeMap[oOptions.size];
|
||||
if (oJQueryOptions.classes['ui-dialog-content'] !== undefined) {
|
||||
oJQueryOptions.classes['ui-dialog-content'] += ' ' + sSize;
|
||||
|
||||
Reference in New Issue
Block a user