Skip to content
Snippets Groups Projects
Commit da58ef23 authored by Saurabh Kumar's avatar Saurabh Kumar
Browse files

Remove unnecessary ‘list-input-files.js’

parent 4d092356
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,6 @@
{% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
<script src="{% static 'js/apply/tinymce-word-count.js' %}"></script>
<script src="{% static 'js/apply/multi-input-fields.js' %}"></script>
<script src="{% static 'js/apply/submission-form-copy.js' %}"></script>
......
......@@ -30,7 +30,3 @@
</div>
</div>
{% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
{% endblock %}
......@@ -44,7 +44,6 @@
{% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
<script src="{% static 'js/apply/tinymce-word-count.js' %}"></script>
<script src="{% static 'js/apply/multi-input-fields.js' %}"></script>
<script src="{% static 'js/apply/submission-form-copy.js' %}"></script>
......
......@@ -73,6 +73,5 @@
{% block extra_js %}
<script src="{% static 'js/apply/jquery.fancybox.min.js' %}"></script>
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
<script src="{% static 'js/apply/fancybox-global.js' %}"></script>
{% endblock %}
......@@ -36,5 +36,4 @@
{% block extra_js %}
{{ form.media.js }}
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
{% endblock %}
......@@ -18,7 +18,3 @@
<a href="{% url 'apply:projects:detail' pk=project.pk %}">{% trans "Visit Project Detail Page" %}</a>
</div>
{% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
{% endblock %}
(function ($) {
'use strict';
function listInputFiles() {
$('input[type=file]').change(function () {
// remove any existing files first
$(this).siblings('.form__file').remove();
for (let i = 0; i < $(this)[0].files.length; ++i) {
$(this).parents('.form__item').prepend(`
<p class="form__file">${$(this)[0].files[i].name}</p>
`);
}
});
}
// Show list of selected files for upload on input[type=file]
listInputFiles();
})(jQuery);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment