Customizer panels: use a single back button for all panels.

This also ensures the back button is visible on iOS devices.

props celloexpressions.
fixes #29135.


git-svn-id: https://develop.svn.wordpress.org/trunk@29610 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2014-08-25 23:04:43 +00:00
parent f1fe507032
commit bcba1996fe
4 changed files with 6 additions and 6 deletions

View File

@ -252,7 +252,7 @@ body {
font: normal 20px/1 dashicons; font: normal 20px/1 dashicons;
content: "\f341"; content: "\f341";
position: relative; position: relative;
top: 13px; top: 7px;
left: 13px; left: 13px;
} }
@ -260,7 +260,7 @@ body {
content: "\f344"; content: "\f344";
} }
.current-panel .control-panel-back { .in-sub-panel .control-panel-back {
left: 0; left: 0;
} }

View File

@ -121,6 +121,7 @@ do_action( 'customize_controls_print_scripts' );
<a class="customize-controls-close" href="<?php echo esc_url( $return ); ?>"> <a class="customize-controls-close" href="<?php echo esc_url( $return ); ?>">
<span class="screen-reader-text"><?php _e( 'Cancel' ); ?></span> <span class="screen-reader-text"><?php _e( 'Cancel' ); ?></span>
</a> </a>
<span class="control-panel-back" tabindex="-1"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></span>
</div> </div>
<?php <?php

View File

@ -47,14 +47,14 @@
}); });
// Go back to the top-level Customizer accordion. // Go back to the top-level Customizer accordion.
$( '.accordion-container' ).on( 'click keydown', '.control-panel-back', function( e ) { $( '#customize-header-actions' ).on( 'click keydown', '.control-panel-back', function( e ) {
if ( e.type === 'keydown' && 13 !== e.which ) { // "return" key if ( e.type === 'keydown' && 13 !== e.which ) { // "return" key
return; return;
} }
e.preventDefault(); // Keep this AFTER the key filter above e.preventDefault(); // Keep this AFTER the key filter above
panelSwitch( $( this ) ); panelSwitch( $( '.current-panel' ) );
}); });
}); });
@ -108,7 +108,7 @@
container = section.closest( '.accordion-container' ), container = section.closest( '.accordion-container' ),
siblings = container.find( '.open' ), siblings = container.find( '.open' ),
topPanel = overlay.find( '#customize-theme-controls > ul > .accordion-section > .accordion-section-title' ).add( '#customize-info > .accordion-section-title' ), topPanel = overlay.find( '#customize-theme-controls > ul > .accordion-section > .accordion-section-title' ).add( '#customize-info > .accordion-section-title' ),
backBtn = section.find( '.control-panel-back' ), backBtn = overlay.find( '.control-panel-back' ),
panelTitle = section.find( '.accordion-section-title' ).first(), panelTitle = section.find( '.accordion-section-title' ).first(),
content = section.find( '.control-panel-content' ); content = section.find( '.control-panel-content' );

View File

@ -174,7 +174,6 @@ class WP_Customize_Panel {
<?php echo esc_html( $this->title ); ?> <?php echo esc_html( $this->title ); ?>
<span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span> <span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span>
</h3> </h3>
<span class="control-panel-back" tabindex="-1"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></span>
<ul class="accordion-sub-container control-panel-content"> <ul class="accordion-sub-container control-panel-content">
<li class="accordion-section control-section<?php if ( empty( $this->description ) ) echo ' cannot-expand'; ?>"> <li class="accordion-section control-section<?php if ( empty( $this->description ) ) echo ' cannot-expand'; ?>">
<div class="accordion-section-title" tabindex="0"> <div class="accordion-section-title" tabindex="0">