Ticket #33024: ticket_33024.diff
File ticket_33024.diff, 3.3 KB (added by , 3 years ago) |
---|
-
django/contrib/admin/static/admin/css/widgets.css
diff --git a/django/contrib/admin/static/admin/css/widgets.css b/django/contrib/admin/static/admin/css/widgets.css index c7d64566d9..d32b2d697c 100644
a b 1 1 /* SELECTOR (FILTER INTERFACE) */ 2 2 3 3 .selector { 4 display: flex; 4 5 width: 800px; 5 6 float: left; 6 7 } … … 8 9 .selector select { 9 10 width: 380px; 10 11 height: 17.2em; 12 flex: 1 0 auto; 11 13 } 12 14 13 15 .selector-available, .selector-chosen { … … 15 17 width: 380px; 16 18 text-align: center; 17 19 margin-bottom: 5px; 20 display: flex; 21 flex-direction: column; 18 22 } 19 23 20 24 .selector-chosen select { … … 63 67 } 64 68 65 69 .selector ul.selector-chooser { 70 align-self: center; 66 71 float: left; 67 72 width: 22px; 68 73 background-color: var(--selected-bg); 69 74 border-radius: 10px; 70 margin: 10em 5px0 5px;75 margin: 0 5px; 71 76 padding: 0; 72 77 } 73 78 -
django/contrib/admin/static/admin/js/SelectFilter2.js
diff --git a/django/contrib/admin/static/admin/js/SelectFilter2.js b/django/contrib/admin/static/admin/js/SelectFilter2.js index a619ba7237..194c2db2fe 100644
a b Requires core.js and SelectBox.js. 153 153 // Move selected from_box options to to_box 154 154 SelectBox.move(field_id + '_from', field_id + '_to'); 155 155 156 if (!is_stacked) {157 // In horizontal mode, give the same height to the two boxes.158 let height;159 const j_from_box = document.getElementById(field_id + '_from');160 const j_to_box = document.getElementById(field_id + '_to');161 const collapsed_fieldsets = Array.from(document.querySelectorAll('fieldset.collapsed'));162 163 const is_selectbox_collapsed = collapsed_fieldsets.some(function(collapsed_fieldset) {164 // Collapsed fieldset contains the selectbox165 if (collapsed_fieldset.querySelector('.field-' + field_name) !== null) {166 collapsed_fieldset.classList.remove('collapsed');167 height = filter_p.offsetHeight + j_from_box.offsetHeight;168 collapsed_fieldset.classList.add('collapsed');169 return true;170 }171 return false;172 });173 174 if (!is_selectbox_collapsed) {175 height = filter_p.offsetHeight + j_from_box.offsetHeight;176 }177 178 const j_to_box_style = window.getComputedStyle(j_to_box);179 if (j_to_box_style.getPropertyValue('box-sizing') === 'border-box') {180 // Add the padding and border to the final height.181 height += parseInt(j_to_box_style.getPropertyValue('padding-top'), 10)182 + parseInt(j_to_box_style.getPropertyValue('padding-bottom'), 10)183 + parseInt(j_to_box_style.getPropertyValue('border-top-width'), 10)184 + parseInt(j_to_box_style.getPropertyValue('border-bottom-width'), 10);185 }186 187 j_to_box.style.height = height + 'px';188 }189 190 156 // Initial icon refresh 191 157 SelectFilter.refresh_icons(field_id); 192 158 },