diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index a02e2b5..d68e5ba 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 | collapsed = state.create( 'collapsed' ); |
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 | collapsed( false ); |
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( 'collapsed' )() === true ) { |
| 3968 | api.trigger( 'collapsed', false ); |
| 3969 | } else { |
| 3970 | api.trigger( 'collapsed', true ); |
| 3971 | } |
| 3972 | |
| 3973 | }); |
| 3974 | |
| 3975 | api.bind( 'collapsed', function( collapsed ) { |
| 3976 | |
| 3977 | if ( collapsed === true ) { |
3965 | 3978 | $( this ).attr({ 'aria-expanded': 'false', 'aria-label': api.l10n.expandSidebar }); |
| 3979 | overlay.addClass( 'collapsed' ).removeClass( 'expanded' ); |
| 3980 | api.state( 'collapsed' ).set(true); |
3966 | 3981 | } else { |
3967 | 3982 | $( this ).attr({ 'aria-expanded': 'true', 'aria-label': api.l10n.collapseSidebar }); |
| 3983 | overlay.removeClass( 'collapsed' ).addClass( 'expanded' ); |
| 3984 | api.state( 'collapsed' ).set(false); |
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( 'collapsed', false ); |
4205 | 4222 | } ); |
4206 | 4223 | |
4207 | 4224 | // Refresh the preview when it requests. |