Skip to content

Commit

Permalink
bug fix for error modal not showing title if present in json
Browse files Browse the repository at this point in the history
  • Loading branch information
lanesCSO committed Oct 21, 2024
1 parent 8e29b19 commit aefa716
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/js/api.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,16 @@ api.modal.success = function (pMessage) {
$("#modal-success").modal("show");
};

/**
* Pop an Error Modal in Bootstrap
* @param {*} pMessage
*/
/**
* Pop an Error Modal in Bootstrap
* @param {*} pMessage
*/
api.modal.error = function (pMessage) {

var msgObj;
if (typeof pMessage == "string") {
try {
Expand All @@ -687,7 +692,11 @@ api.modal.error = function (pMessage) {
$("#modal-error").find('[name=more-info-content]').addClass('d-none');

if (typeof pMessage == "object") {
$("#modal-error").find('[name=message-text]').empty().html(msgObj);
if (msgObj.hasOwnProperty('title')) {
$("#modal-error").find('[name=message-text]').empty().html(msgObj.title);
} else {
$("#modal-error").find('[name=message-text]').empty().html(msgObj);
}
} else {
$("#modal-error").find('[name=message-text]').empty().html(msgObj.title);
}
Expand Down
Loading

0 comments on commit aefa716

Please sign in to comment.