fixed dropdown template - only load javascript if actually needed

This commit is contained in:
Thomas Leichtfuß
2020-09-05 12:55:51 +02:00
parent 436b86b7a0
commit 0597a29735
@@ -17,10 +17,12 @@
{% endif %}
</ul>
<script>
(function($) {
$('select#{{ title|slugify }}_filter_select').change(function(evt) {
window.location.href = $(this).val();
});
})(django.jQuery);
</script>
{% if choices|slice:"4:" %}
<script>
(function($) {
$('select#{{ title|slugify }}_filter_select').change(function(evt) {
window.location.href = $(this).val();
});
})(django.jQuery);
</script>
{% endif %}