When setting HTML content to a modal, the content isn't displayed.
Basically, what I do :
// Creation of the HTML content... More complete in the real world :-)
var wMessage = new Element('div', {'class':'message'}).set('text', 'This is my user message');
var wContent = new Element('div').adopt(wMessage);
// I set my options
var options = {
id: 'wdelconfirm0',
content: wContent,
title: 'The window title',
cssClass:'confirmation',
draggable: true,
padding: { top: 15, right: 15, bottom: 8, left: 15 }
}
// Modal creation
new MUI.Modal(options);
The problem is in window.js line 1141, the type of the content option is 'element', so the switch case will be 'default' and the content is pushed to the sections array. :
switch (typeOf(options.content)){
case 'string':
// was passed html, so make sure it is added
this.sections.push({
loadMethod:'html',
content:options.content
});
break;
case 'array':
this.sections = options.content;
break;
default:
/*
* HTML Element will be considered here....not correct
*/
this.sections.push(options.content);
}
Proposed solution :
switch (typeOf(options.content)){
case 'string':
case 'element':
/*
* HTML Element will now be considered here....
*/
// was passed html, so make sure it is added
this.sections.push({
loadMethod:'html',
content:options.content
});
break;
case 'array':
this.sections = options.content;
break;
default:
this.sections.push(options.content);
}
When setting HTML content to a modal, the content isn't displayed.
Basically, what I do :
The problem is in window.js line 1141, the type of the content option is 'element', so the switch case will be 'default' and the content is pushed to the sections array. :
Proposed solution :