47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
|
$("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;
|
||
|
});
|