Bug 23385: Hide 'Default values' fields by default

To test:
1 - Go to Tools->Import patrons
2 - Choose a file
3 - Scroll a long way to submit
4 - Apply patch
5 - Choose a file
6 - Can submit easily
7 - Click to expand and enter default fields
8 - Confirm can still submit and that values entered are used

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-07-26 14:48:51 +00:00 committed by Martin Renvoize
parent 9f11eef934
commit 9258d385ba
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -159,9 +159,12 @@
</fieldset>
<fieldset class="rows">
<legend>Default values</legend>
<legend>
<a class="expand_defaults">Click to enter default values</a>
<a class="expand_defaults" style="display:none;">Hide default value fields</a>
</legend>
<ol>
<ol class="default_values" style="display:none;">
[% FOREACH borrower_field IN borrower_fields %]
[% SWITCH borrower_field.field %]
@ -303,6 +306,11 @@ you can supply dates in ISO format (e.g., '2010-10-28').
$(document).ready(function() {
[%# Make date fields have the datepicker %]
$("#dateenrolled, #dateexpiry, #dateofbirth").datepicker();
$(".expand_defaults").click(function(){
$(".default_values").toggle();
$(".expand_defaults").toggle();
});
});
</script>
[% END %]