mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
NCM2
This commit is contained in:
parent
ed4f5845d7
commit
8346a233be
@ -329,7 +329,20 @@ function load_modal(settings) {
|
||||
} else {
|
||||
settings.ajax_callback(data);
|
||||
}
|
||||
} else {
|
||||
generalShowMsg(data, null);
|
||||
}
|
||||
|
||||
AJAX_RUNNING = 0;
|
||||
},
|
||||
error: function(response) {
|
||||
generalShowMsg(
|
||||
{
|
||||
title: "Failed",
|
||||
text: response.responseText
|
||||
},
|
||||
null
|
||||
);
|
||||
AJAX_RUNNING = 0;
|
||||
}
|
||||
});
|
||||
@ -543,9 +556,26 @@ function confirmDialog(settings) {
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function generalShowMsg(data, idMsg) {
|
||||
var title = data.title[data.error];
|
||||
var text = data.text[data.error];
|
||||
var failed = !data.error;
|
||||
var title = "Response";
|
||||
var text = data;
|
||||
var failed = false;
|
||||
|
||||
if (typeof data == "object") {
|
||||
title = data.title || "Response";
|
||||
text = data.text || data.error || data.result;
|
||||
failed = failed || data.error;
|
||||
}
|
||||
|
||||
if (failed) text = data.error;
|
||||
|
||||
if (idMsg == null) {
|
||||
idMsg = uniqId();
|
||||
}
|
||||
|
||||
if ($("#" + idMsg).length === 0) {
|
||||
$("body").append('<div title="' + title + '" id="' + idMsg + '"></div>');
|
||||
$("#" + idMsg).empty();
|
||||
}
|
||||
|
||||
$("#" + idMsg).empty();
|
||||
$("#" + idMsg).html(text);
|
||||
|
Loading…
x
Reference in New Issue
Block a user