feat: Aktivieren Sie die Schaltfläche für die mobile Ablehnung.

- Ereignis hinzugefügt.
 - In die Mitte der Schaltflächenleiste verschoben
This commit is contained in:
Developer 02
2024-10-14 17:06:01 +02:00
parent e528fa6409
commit 1dd9ce6bbc
6 changed files with 67 additions and 63 deletions

View File

@@ -87,6 +87,7 @@ class App {
//add click events of external buttons
[...document.getElementsByClassName('btn_refresh')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('RESET')));
[...document.getElementsByClassName('btn_complete')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('FINISH')));
[...document.getElementsByClassName('btn_reject')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('REJECT')));
}
handleAnnotationsLoad(loadedAnnotations) {
@@ -163,7 +164,41 @@ class App {
break
case 'REJECT':
alert('Dokument abgelent!')
Swal.fire({
title: localized.rejection,
html: `<div class="text-start fs-6 p-0 m-0">${localized.rejectionReasonQ}</div>`,
icon: "question",
input: "text",
inputAttributes: {
autocapitalize: "off"
},
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: localized.complete,
cancelButtonText: localized.back,
showLoaderOnConfirm: true,
preConfirm: async (reason) => {
try {
var res = await rejectEnvelope(reason);
return res;
} catch (error) {
Swal.showValidationMessage(`
Request failed: ${error}
`);
}
},
allowOutsideClick: () => !Swal.isLoading()
}).then((result) => {
if (!result.isConfirmed)
return;
const res = result.value;
if (res.ok) {
redirRejected()
}
else
Swal.showValidationMessage(`Request failed: ${res.message}`);
});
break;
case 'SHARE':