diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index a02e2b5..93519da 100644
|
|
|
3899 | 3899 | var state = new api.Values(), |
3900 | 3900 | saved = state.create( 'saved' ), |
3901 | 3901 | activated = state.create( 'activated' ), |
3902 | | processing = state.create( 'processing' ); |
| 3902 | processing = state.create( 'processing' ), |
| 3903 | paneVisible = state.create( 'paneVisible' ); |
3903 | 3904 | |
3904 | 3905 | state.bind( 'change', function() { |
3905 | 3906 | if ( ! activated() ) { |
… |
… |
|
3920 | 3921 | saved( true ); |
3921 | 3922 | activated( api.settings.theme.active ); |
3922 | 3923 | processing( 0 ); |
| 3924 | paneVisible( true ); |
3923 | 3925 | |
3924 | 3926 | api.bind( 'change', function() { |
3925 | 3927 | state('saved').set( false ); |
… |
… |
|
3961 | 3963 | }); |
3962 | 3964 | |
3963 | 3965 | $( '.collapse-sidebar' ).on( 'click', function() { |
3964 | | if ( 'true' === $( this ).attr( 'aria-expanded' ) ) { |
| 3966 | |
| 3967 | if ( api.state( 'paneVisible' )() === true ) { |
| 3968 | api.trigger( 'paneVisible', false ); |
| 3969 | } else { |
| 3970 | api.trigger( 'paneVisible', true ); |
| 3971 | } |
| 3972 | |
| 3973 | }); |
| 3974 | |
| 3975 | api.bind( 'paneVisible', function( paneVisible ) { |
| 3976 | |
| 3977 | if ( paneVisible === false ) { |
3965 | 3978 | $( this ).attr({ 'aria-expanded': 'false', 'aria-label': api.l10n.expandSidebar }); |
| 3979 | overlay.addClass( 'collapsed' ).removeClass( 'expanded' ); |
| 3980 | api.state( 'paneVisible' ).set(false); |
3966 | 3981 | } else { |
3967 | 3982 | $( this ).attr({ 'aria-expanded': 'true', 'aria-label': api.l10n.collapseSidebar }); |
| 3983 | overlay.removeClass( 'collapsed' ).addClass( 'expanded' ); |
| 3984 | api.state( 'paneVisible' ).set(true); |
3968 | 3985 | } |
3969 | 3986 | |
3970 | | overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); |
3971 | 3987 | }); |
3972 | 3988 | |
3973 | 3989 | // Keyboard shortcuts - esc to exit section/panel. |
… |
… |
|
4202 | 4218 | if ( matchedControl ) { |
4203 | 4219 | matchedControl.focus(); |
4204 | 4220 | } |
| 4221 | api.trigger( 'paneVisible', true ); |
4205 | 4222 | } ); |
4206 | 4223 | |
4207 | 4224 | // Refresh the preview when it requests. |
diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
index e514a0a..2c75091 100644
|
|
|
2931 | 2931 | var control = api.Menus.getMenuItemControl( menuItemId ); |
2932 | 2932 | |
2933 | 2933 | if ( control ) { |
| 2934 | api.trigger( 'paneVisible', true ); |
2934 | 2935 | control.focus(); |
2935 | 2936 | } |
2936 | 2937 | }; |
diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
index 7598023..d903b4b 100644
|
|
|
2099 | 2099 | var control = api.Widgets.getWidgetFormControlForWidget( widgetId ); |
2100 | 2100 | |
2101 | 2101 | if ( control ) { |
| 2102 | api.trigger( 'paneVisible', true ); |
2102 | 2103 | control.focus(); |
2103 | 2104 | } |
2104 | 2105 | }, |