portal.mkgtu.ru/clientSide/packs/js/passport-data.js

47 lines
1.2 KiB
JavaScript
Executable File

$("body").on("submit", ".passport-form", function (e) {
e.preventDefault();
var passportSuccessFunction = function passportSuccessFunction(res) {
$(".passport-modal").modal("hide");
$.ajax({
url: passportGridUrl,
method: "GET",
dataType: "html",
success: function success(response) {
$("#passport-grid").html(response);
}
});
$.ajax({
url: passportModalsUrl,
method: "GET",
dataType: "html",
success: function success(response) {
$("#passport-modals").html(response);
}
});
$("#alert-missing-passport").hide();
};
var textForAjaxTooltip =
typeof globalTextForAjaxTooltip === "undefined"
? "Запрос обрабатывается..."
: globalTextForAjaxTooltip;
ajaxSender(
$(this).attr("action"),
"POST",
new FormData(this),
$(this).find(".btn-save-passport"),
passportSuccessFunction,
null,
textForAjaxTooltip,
"top",
{
contentType: false,
cache: false,
processData: false
}
);
return false;
});