Weiteren Einzelunterschriften-Bug behoben.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
@using BeWoPlanerMobil.Util
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(() => {
|
||||
@@ -86,15 +87,15 @@
|
||||
closeButton.parentNode.replaceChild(closeButtonClone, closeButton);
|
||||
|
||||
function saveBtnListener(event) {
|
||||
saveButtonEvent(serviceRecordOid);
|
||||
singleSignatureSaveButtonEvent(serviceRecordOid);
|
||||
}
|
||||
|
||||
function clearBtnListener(event) {
|
||||
clearButtonEvent(signaturePad);
|
||||
singleSignatureClearButtonEvent(signaturePad);
|
||||
}
|
||||
|
||||
function closeBtnListener(event) {
|
||||
cancelButtonEvent(signaturePad);
|
||||
singleSignatureCloseButtonEvent(signaturePad);
|
||||
}
|
||||
|
||||
saveButtonClone.addEventListener("click", saveBtnListener);
|
||||
@@ -103,7 +104,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
function saveButtonEvent(selectedServiceRecordOid) {
|
||||
function singleSignatureSaveButtonEvent(selectedServiceRecordOid) {
|
||||
const date = new Date();
|
||||
|
||||
const clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("single-signature-sketch-pad")));
|
||||
@@ -117,32 +118,53 @@
|
||||
|
||||
const formattedDate = getDateAndTimeAsString(date, true);
|
||||
|
||||
const form = $("<form>",
|
||||
{
|
||||
method: "post",
|
||||
action: "@Url.Action("SaveSignature", "Main")"
|
||||
});
|
||||
|
||||
form.append(
|
||||
$("<input>",
|
||||
{
|
||||
type: "hidden",
|
||||
name: "@FormCollectionConstants.ServiceRecordSignatureBlobKey",
|
||||
value: dataUrl
|
||||
})
|
||||
);
|
||||
|
||||
form.append($("<input>",
|
||||
{
|
||||
type: "hidden",
|
||||
name: "@FormCollectionConstants.ServiceRecordSignatureDateKey",
|
||||
value: formattedDate
|
||||
}));
|
||||
|
||||
form.append($("<input>",
|
||||
{
|
||||
type: "hidden",
|
||||
name: "@FormCollectionConstants.ServiceRecordSignatureRecordOidKey",
|
||||
value: selectedServiceRecordOid
|
||||
}));
|
||||
|
||||
showSpinner();
|
||||
|
||||
$(`#sr-sig-blob-${selectedServiceRecordOid}`).val(dataUrl);
|
||||
$(`#sr-sig-date-${selectedServiceRecordOid}`).val(formattedDate);
|
||||
$(`#save-signature-form-${selectedServiceRecordOid}`).submit();
|
||||
$("#sr-sg-container").append(form);
|
||||
|
||||
form.submit();
|
||||
|
||||
$("#single-signature-modal").modal("hide");
|
||||
}
|
||||
|
||||
function cancelButtonEvent(signaturePad) {
|
||||
function singleSignatureCloseButtonEvent(signaturePad) {
|
||||
$("#single-signature-modal").modal("hide");
|
||||
|
||||
signaturePad.clear();
|
||||
|
||||
return;
|
||||
|
||||
@* Es wird schon ein Popup angezeigt. Deswegen kann kein zweites angezeigt werden. Das läge nämlich unter dem ersten Popup! *@
|
||||
showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
|
||||
() => {
|
||||
$("#single-signature-modal").modal("hide");
|
||||
|
||||
signaturePad.clear();
|
||||
}, false);
|
||||
}
|
||||
|
||||
function clearButtonEvent(signaturePad) {
|
||||
function singleSignatureClearButtonEvent(signaturePad) {
|
||||
signaturePad.clear();
|
||||
}
|
||||
</script>
|
||||
@@ -167,6 +189,8 @@ else
|
||||
|
||||
var info = $"{nameAndDateOfBirth} | {supportConceptTimeSpan}";
|
||||
|
||||
<div id="sr-sg-container"></div>
|
||||
|
||||
<div id="single-signature-modal" class="modal" tabindex="-1" role="dialog" data-backdrop="static">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
|
||||
Reference in New Issue
Block a user