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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51977 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John James Jacoby 2021-11-02 17:06:16 +00:00
parent dbf96aadab
commit df8a2b408b

View File

@ -854,7 +854,7 @@ $( function() {
// Reset any compensation for submenus near the bottom of the screen.
$('#adminmenu div.wp-submenu').css('margin-top', '');
if ( viewportWidth < 960 ) {
if ( viewportWidth <= 960 ) {
if ( $body.hasClass('auto-fold') ) {
$body.removeClass('auto-fold').removeClass('folded');
setUserSetting('unfold', 1);