Quand on n'a pas de fileInput, on ne charge pas le js correspondant
This commit is contained in:
parent
3af0ab9971
commit
c1bc5c1d05
1 changed files with 3 additions and 1 deletions
|
@ -4,7 +4,8 @@
|
|||
|
||||
{% block extra_head %}
|
||||
<script>
|
||||
$(document).ready(function($) {
|
||||
{% if not election.sent_mail %}
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const fileInput = document.querySelector('#import-voters input[type=file]');
|
||||
fileInput.onchange = () => {
|
||||
if (fileInput.files.length > 0) {
|
||||
|
@ -13,6 +14,7 @@
|
|||
}
|
||||
};
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue