Skip to content

Commit fc635ec

Browse files
committed
add min-width for filter & actions
1 parent d19eb01 commit fc635ec

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

adminlteui/templates/admin/actions.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
{% endblock %}
2525
</div>
2626
</div>
27-
<script>document.querySelector('.actions select').setAttribute('class', 'form-control')</script>
27+
<script>
28+
document.querySelector('.actions select').setAttribute('class', 'form-control');
29+
document.querySelector('.actions select').style.minWidth='200px';
30+
</script>
2831
</div>

adminlteui/templates/admin/filter.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load i18n %}
22

33
<div class="form-group" style="margin-bottom: 5px;">
4-
<select id="id_filter_{{ field_name }}" class="form-control search-filter" style="width: 100%;" tabindex="-1" aria-hidden="true">
4+
<select id="id_filter_{{ field_name }}" class="form-control search-filter" style="width: 100%; min-width: 200px;" tabindex="-1" aria-hidden="true">
55
<option value="">{{ title }}</option>
66
<option value="">---------</option>
77
{% for choice in choices %}
@@ -15,8 +15,10 @@
1515
{% if spec.display_select2 %}
1616
<script>
1717
django.jQuery('#id_filter_{{ field_name }}').select2({
18-
width: django.jQuery('#id_filter_{{ field_name }}').width() + 26
18+
dropdownAutoWidth : true,
19+
width: '100%'
1920
})
21+
django.jQuery('#id_filter_{{ field_name }}').parent().find('span.select2-container').css({'min-width': '200px'})
2022
django.jQuery('#id_filter_{{ field_name }}').on('select2:select', function (e) {
2123
if (e.params.data.id !=='') {
2224
django.jQuery('#id_filter_{{ field_name }}').attr('name', e.params.data.element.dataset.name)

0 commit comments

Comments
 (0)