Merge pull request #1312 from nemo9l/improve/exec_json

#1311 exec_json 에서 callback_error 의 반환값에 따라 alert 하지 않도록 수정
This commit is contained in:
Kijin Sung 2020-06-12 08:20:35 +09:00 committed by GitHub
commit 369858012e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -241,11 +241,12 @@
// If the response contains an error, display the error message.
if(data.error != "0" && data.error > -1000) {
// Should not display the error message when the callback function returns false.
if ($.isFunction(callback_error) && callback_error(data) === false) {
return;
}
if(data.error == -1 && data.message == "admin.msg_is_not_administrator") {
alert("You are not logged in as an administrator.");
if ($.isFunction(callback_error)) {
callback_error(data);
}
return;
} else {
if (data.message) {
@ -253,9 +254,6 @@
} else {
alert("AJAX communication error while requesting " + request_info);
}
if ($.isFunction(callback_error)) {
callback_error(data);
}
return;
}
}