From b53cbb127992e0461189298b00a8143274ed78fd Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 28 Jul 2015 03:42:36 +0000 Subject: [PATCH] Customizer: Hide empty space in footer on small screens since it is only populated on larger screens. Props obenland. Fixes #33138. git-svn-id: https://develop.svn.wordpress.org/trunk@33454 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index c5910b1c43..ff93d5fa49 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -595,12 +595,21 @@ } else { container.scrollTop( 0 ); expand = function () { + var matchMedia, offset; + matchMedia = window.matchMedia || window.msMatchMedia; + offset = 90; // 45px for customize header actions + 45px for footer actions. + + // No footer on small screens. + if ( matchMedia && matchMedia( '(max-width: 640px)' ).matches ) { + offset = 45; + } + section.container.addClass( 'open' ); overlay.addClass( 'section-open' ); position = content.offset().top; scroll = container.scrollTop(); content.css( 'margin-top', ( 45 - position - scroll ) ); - content.css( 'height', ( window.innerHeight - 90 ) ); + content.css( 'height', ( window.innerHeight - offset ) ); sectionTitle.attr( 'tabindex', '-1' ); backBtn.attr( 'tabindex', '0' ); backBtn.focus();