Make WordPress Core

Changeset 51977


Ignore:
Timestamp:
11/02/2021 05:06:16 PM (2 years ago)
Author:
johnjamesjacoby
Message:

Admin/Menu: include 960 exact pixel width in collapse measurements.

This change removes a 1 pixel gap in the measurement of the viewport width when clicking the "Collapse menu" button (at the bottom of the admin menu UI) when already collapsed, causing the menu not to open as intended when exactly 960 pixels wide.

Before this change, the menu would be stuck in the collapsed position. After this change, the menu opens as expected.

Props abesell132, ankit-k-gupta, audrasjb, boniu91, mai21, sabernhardt, webaxones.

Fixes #54210.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/common.js

    r51946 r51977  
    855855        $('#adminmenu div.wp-submenu').css('margin-top', '');
    856856
    857         if ( viewportWidth < 960 ) {
     857        if ( viewportWidth <= 960 ) {
    858858            if ( $body.hasClass('auto-fold') ) {
    859859                $body.removeClass('auto-fold').removeClass('folded');
Note: See TracChangeset for help on using the changeset viewer.