mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
NCM2
This commit is contained in:
parent
ed4f5845d7
commit
8346a233be
@ -329,7 +329,20 @@ function load_modal(settings) {
|
|||||||
} else {
|
} else {
|
||||||
settings.ajax_callback(data);
|
settings.ajax_callback(data);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
generalShowMsg(data, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AJAX_RUNNING = 0;
|
||||||
|
},
|
||||||
|
error: function(response) {
|
||||||
|
generalShowMsg(
|
||||||
|
{
|
||||||
|
title: "Failed",
|
||||||
|
text: response.responseText
|
||||||
|
},
|
||||||
|
null
|
||||||
|
);
|
||||||
AJAX_RUNNING = 0;
|
AJAX_RUNNING = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -543,9 +556,26 @@ function confirmDialog(settings) {
|
|||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
function generalShowMsg(data, idMsg) {
|
function generalShowMsg(data, idMsg) {
|
||||||
var title = data.title[data.error];
|
var title = "Response";
|
||||||
var text = data.text[data.error];
|
var text = data;
|
||||||
var failed = !data.error;
|
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).empty();
|
||||||
$("#" + idMsg).html(text);
|
$("#" + idMsg).html(text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user