From 4b478549d2e6817f26cff512e61265ae11f7db03 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 30 Oct 2016 04:22:18 +0000 Subject: [PATCH] Customize: Reveal controls pane when clicking on edit shortcuts in mobile preview. Re-use `paneVisible` state to also manage whether the mobile `preview-only` class is applied to the overlay. Props seancjones. See #36678, #36678, #27403. Fixes #38080. git-svn-id: https://develop.svn.wordpress.org/trunk@39010 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index fecdd1a908..56c061f04a 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -5272,6 +5272,7 @@ }); api.state( 'paneVisible' ).bind( function( paneVisible ) { + overlay.toggleClass( 'preview-only', ! paneVisible ); overlay.toggleClass( 'expanded', paneVisible ); overlay.toggleClass( 'collapsed', ! paneVisible ); @@ -5331,7 +5332,7 @@ }); $( '.customize-controls-preview-toggle' ).on( 'click', function() { - overlay.toggleClass( 'preview-only' ); + api.state( 'paneVisible' ).set( ! api.state( 'paneVisible' ).get() ); }); /*