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 %}
|
{% block extra_head %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function($) {
|
{% if not election.sent_mail %}
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const fileInput = document.querySelector('#import-voters input[type=file]');
|
const fileInput = document.querySelector('#import-voters input[type=file]');
|
||||||
fileInput.onchange = () => {
|
fileInput.onchange = () => {
|
||||||
if (fileInput.files.length > 0) {
|
if (fileInput.files.length > 0) {
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue