Dialog buttons should be defined with an array.
This commit is contained in:
parent
e505f2bd32
commit
4114bdc7bb
1 changed files with 13 additions and 8 deletions
|
@ -36,9 +36,9 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
||||||
*
|
*
|
||||||
* @param {String} title The title of the message box.
|
* @param {String} title The title of the message box.
|
||||||
* @param {String} message The message of the dialog.
|
* @param {String} message The message of the dialog.
|
||||||
* @param {Array} messageButtons Contains the dialog buttons along with their functions.
|
* @param {Array} buttons Contains the dialog buttons along with their functions.
|
||||||
*/
|
*/
|
||||||
exports.displayMessageBox = function(title, message, messageButtons) {
|
exports.displayMessageBox = function(title, message, buttons) {
|
||||||
// Check arguments integrity.
|
// Check arguments integrity.
|
||||||
if (title == undefined || title == '') {
|
if (title == undefined || title == '') {
|
||||||
title = '<No Title Given>';
|
title = '<No Title Given>';
|
||||||
|
@ -48,11 +48,16 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
||||||
message = '<No Message Given>';
|
message = '<No Message Given>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageButtons == undefined) {
|
if (buttons == undefined) {
|
||||||
messageButtons = {};
|
buttons = [
|
||||||
messageButtons[EALang.close] = function() {
|
{
|
||||||
$('#message_box').dialog('close');
|
text: EALang.close,
|
||||||
};
|
click: function () {
|
||||||
|
$('#message_box').dialog('close');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroy previous dialog instances.
|
// Destroy previous dialog instances.
|
||||||
|
@ -73,7 +78,7 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
||||||
width: 'auto',
|
width: 'auto',
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
resizable: false,
|
resizable: false,
|
||||||
buttons: messageButtons,
|
buttons: buttons,
|
||||||
closeOnEscape: true
|
closeOnEscape: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue