Skip to content

Commit aefa716

Browse files
committed
bug fix for error modal not showing title if present in json
1 parent 8e29b19 commit aefa716

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/js/api.library.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,16 @@ api.modal.success = function (pMessage) {
662662
$("#modal-success").modal("show");
663663
};
664664

665+
/**
666+
* Pop an Error Modal in Bootstrap
667+
* @param {*} pMessage
668+
*/
665669
/**
666670
* Pop an Error Modal in Bootstrap
667671
* @param {*} pMessage
668672
*/
669673
api.modal.error = function (pMessage) {
674+
670675
var msgObj;
671676
if (typeof pMessage == "string") {
672677
try {
@@ -687,7 +692,11 @@ api.modal.error = function (pMessage) {
687692
$("#modal-error").find('[name=more-info-content]').addClass('d-none');
688693

689694
if (typeof pMessage == "object") {
690-
$("#modal-error").find('[name=message-text]').empty().html(msgObj);
695+
if (msgObj.hasOwnProperty('title')) {
696+
$("#modal-error").find('[name=message-text]').empty().html(msgObj.title);
697+
} else {
698+
$("#modal-error").find('[name=message-text]').empty().html(msgObj);
699+
}
691700
} else {
692701
$("#modal-error").find('[name=message-text]').empty().html(msgObj.title);
693702
}

0 commit comments

Comments
 (0)