Set focus on all Begruendungs-textareas

This makes it easier to directly add and complete Begruendungen.
Changed in STGL and Lecotors Overview and Detailview
This commit is contained in:
Cris
2023-03-16 09:05:49 +01:00
parent d69788e8d2
commit d606418072
4 changed files with 8 additions and 13 deletions
@@ -495,12 +495,10 @@ var approveAnrechnungDetail = {
// Remove helptext
begruendung = begruendung.replace(helptext, '');
// Focus into textarea to encourage writing
textarea.focus();
}
// Copy begruendung into textarea
textarea.val($.trim(begruendung));
// Copy begruendung into textarea and set focus
textarea.val($.trim(begruendung)).focus();
},
formatEmpfehlungIsRequested: function(statusBezeichnung, empfehlungsanfrageAm, empfehlungsanfrageAn) {
$('#approveAnrechnungDetail-empfehlungDetail-empfehlungsanfrageAm').html(empfehlungsanfrageAm);
@@ -701,8 +701,8 @@ var approveAnrechnung = {
// Find closest textarea
let textarea = $(elem).closest('div').find('textarea');
// Copy begruendung into textarea
textarea.val($.trim($(elem).parent().text()));
// Copy begruendung into textarea and set focus
textarea.val($.trim($(elem).parent().text())).focus();
},
focusFilterbuttonIfTableStartsWithStoredFilter(filters){
switch (filters[0].value) {
@@ -263,13 +263,10 @@ var reviewAnrechnung = {
// Remove helptext
begruendung = begruendung.replace(helptext, '');
// Focus into textarea to encourage writing
textarea.focus();
}
// Copy begruendung into textarea
textarea.val($.trim(begruendung));
// Copy begruendung into textarea and set focus
textarea.val($.trim(begruendung)).focus();
},
formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon, statusBezeichnung){
@@ -441,7 +441,7 @@ var reviewAnrechnung = {
// Find closest textarea
let textarea = $(elem).closest('div').find('textarea');
// Copy begruendung into textarea
textarea.val($.trim($(elem).parent().text()));
// Copy begruendung into textarea and set focus
textarea.val($.trim($(elem).parent().text())).focus();
}
}