Ticket #33024: ticket_33024.diff

File ticket_33024.diff, 3.3 KB (added by Shubh Parmar, 2 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  
    11/* SELECTOR (FILTER INTERFACE) */
    22
    33.selector {
     4    display: flex;
    45    width: 800px;
    56    float: left;
    67}
     
    89.selector select {
    910    width: 380px;
    1011    height: 17.2em;
     12    flex: 1 0 auto;
    1113}
    1214
    1315.selector-available, .selector-chosen {
     
    1517    width: 380px;
    1618    text-align: center;
    1719    margin-bottom: 5px;
     20    display: flex;
     21    flex-direction: column;
    1822}
    1923
    2024.selector-chosen select {
     
    6367}
    6468
    6569.selector ul.selector-chooser {
     70    align-self: center;
    6671    float: left;
    6772    width: 22px;
    6873    background-color: var(--selected-bg);
    6974    border-radius: 10px;
    70     margin: 10em 5px 0 5px;
     75    margin: 0 5px;
    7176    padding: 0;
    7277}
    7378
  • 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.  
    153153            // Move selected from_box options to to_box
    154154            SelectBox.move(field_id + '_from', field_id + '_to');
    155155
    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 selectbox
    165                     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 
    190156            // Initial icon refresh
    191157            SelectFilter.refresh_icons(field_id);
    192158        },
Back to Top