Skip to content

Commit

Permalink
Only require reason when other category is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp-work committed Oct 6, 2023
1 parent 8618735 commit 4f0c015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/app/assets/javascripts/webui/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ function hideReportButton(element) {

$(document).ready(function(){
$('#report-category').on('change', '.form-check-input', function(e) {
$('#report-reason').toggleClass('d-none', ( e.target.value !== 'other' ));
$('#report-reason textarea').attr('required', (e.target.value !== 'other' ? null : true));
});
});
2 changes: 1 addition & 1 deletion src/api/app/views/webui/shared/_report_modal.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.form-check
= radio.radio_button(class: 'form-check-input')
= radio.label(class: 'form-check-label')
.d-none#report-reason
#report-reason
= form.label('Reason:')
= form.text_area(:reason, class: 'form-control')
.text-muted
Expand Down

0 comments on commit 4f0c015

Please sign in to comment.