Checkboxy pouze u multiple selectu (přesněji řečeno pouze u těch, kde je select2multiple)
This commit is contained in:
parent
2ef3311bff
commit
dce1de7a99
2 changed files with 8 additions and 3 deletions
|
@ -1264,16 +1264,17 @@ label[for=id_skola] {
|
|||
|
||||
/* Select2 používaný hlavně multiple selectem. Přidání checkboxů a změna barvy. */
|
||||
/* Podle https://stackoverflow.com/a/48290544 */
|
||||
.select2-results__option[aria-selected=true]:before {
|
||||
/* U autocomplete.ModelSelect2Multiple vyžaduje 'data-dropdown-css-class': 'select2multiple' */
|
||||
.select2multiple .select2-results__option[aria-selected=true]:before {
|
||||
content: '☑ ';
|
||||
padding: 0 0 0 8px;
|
||||
}
|
||||
|
||||
.select2-results__option[aria-selected=false]:before {
|
||||
.select2multiple .select2-results__option[aria-selected=false]:before {
|
||||
content: '◻ ';
|
||||
padding: 0 0 0 8px;
|
||||
}
|
||||
|
||||
.select2-results__option--highlighted {
|
||||
.select2multiple .select2-results__option--highlighted {
|
||||
background-color: #e84e10 !important;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ class PosliReseniForm(forms.Form):
|
|||
'data-placeholder--id': '-1',
|
||||
'data-placeholder--text': '---',
|
||||
'data-close-on-select': 'false',
|
||||
'data-dropdown-css-class': 'select2multiple',
|
||||
'data-allow-clear': 'true'
|
||||
},
|
||||
),
|
||||
|
@ -45,6 +46,7 @@ class PosliReseniForm(forms.Form):
|
|||
attrs = {'data-placeholder--id': '-1',
|
||||
'data-placeholder--text' : '---',
|
||||
'data-close-on-select': 'false',
|
||||
'data-dropdown-css-class': 'select2multiple',
|
||||
'data-allow-clear': 'true'})
|
||||
)
|
||||
|
||||
|
@ -77,6 +79,7 @@ class NahrajReseniForm(forms.ModelForm):
|
|||
attrs = {'data-placeholder--id': '-1',
|
||||
'data-placeholder--text' : '---',
|
||||
'data-close-on-select': 'false',
|
||||
'data-dropdown-css-class': 'select2multiple',
|
||||
'data-allow-clear': 'true'},
|
||||
forward=["nadproblem_id"],
|
||||
),
|
||||
|
@ -86,6 +89,7 @@ class NahrajReseniForm(forms.ModelForm):
|
|||
attrs = {'data-placeholder--id': '-1',
|
||||
'data-placeholder--text' : '---',
|
||||
'data-close-on-select': 'false',
|
||||
'data-dropdown-css-class': 'select2multiple',
|
||||
'data-allow-clear': 'true'},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue