Multiple select se nemají zavírat
This commit is contained in:
parent
317cc3056e
commit
4a3f8c669d
3 changed files with 10 additions and 1 deletions
7
odevzdavatko/static/odevzdavatko/select2.js
Normal file
7
odevzdavatko/static/odevzdavatko/select2.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Nenechá select2 (používaný pro multiple select) se zavřít po výběru
|
||||
$(window).on('load', function () {
|
||||
// Z nějakého důvodu nestačí onload, ale libovolný timeout pomůže. BÚNO 0.5 sekundy, kdyby to bylo rychlostí mého počítače
|
||||
setTimeout(function() {
|
||||
$(".select2-hidden-accessible").select2({closeOnSelect: false})
|
||||
}, 500)
|
||||
});
|
|
@ -1,7 +1,8 @@
|
|||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% block script %}
|
||||
<script src="{% static 'odevzdavatko/dynamic_formsets.js' %}"></script>
|
||||
<script src="{% static 'odevzdavatko/dynamic_formsets.js' %}"></script>
|
||||
<script src="{% static 'odevzdavatko/select2.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!--script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.js' %}"></script!-->
|
||||
{{form.media}}
|
||||
<script src="{% static 'odevzdavatko/dynamic_formsets.js' %}"></script>
|
||||
<script src="{% static 'odevzdavatko/select2.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
Loading…
Reference in a new issue