mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Theme Customizer: Change 'Return to...' link to 'Cancel' and move 'Save' button to header. props helenyhou, fixes #20692, see #19910.
git-svn-id: http://core.svn.wordpress.org/trunk@20864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f6882e94ef
commit
4973f92107
@ -50,8 +50,13 @@ do_action( 'customize_controls_print_scripts' );
|
||||
<form id="customize-controls" class="wrap wp-full-overlay-sidebar">
|
||||
<?php wp_nonce_field( 'customize_controls' ); ?>
|
||||
<div id="customize-header-actions" class="wp-full-overlay-header">
|
||||
<a class="back" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
|
||||
<?php printf( __( '← Return to %s' ), __('Manage Themes') ); ?>
|
||||
<?php
|
||||
$save_text = $wp_customize->is_theme_active() ? __( 'Save' ) : __( 'Save and Activate' );
|
||||
submit_button( $save_text, 'primary', 'save', false );
|
||||
?>
|
||||
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
|
||||
<a class="back button" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
|
||||
<?php _e( 'Cancel' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -81,12 +86,6 @@ do_action( 'customize_controls_print_scripts' );
|
||||
</div>
|
||||
|
||||
<div id="customize-footer-actions" class="wp-full-overlay-footer">
|
||||
<?php
|
||||
$save_text = $wp_customize->is_theme_active() ? __('Save') : __('Save and Activate');
|
||||
submit_button( $save_text, 'primary', 'save', false );
|
||||
?>
|
||||
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
|
||||
|
||||
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
|
||||
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
|
||||
<span class="collapse-sidebar-arrow"></span>
|
||||
|
@ -131,20 +131,20 @@ body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#customize-footer-actions img {
|
||||
#customize-header-actions .button-primary {
|
||||
float: right;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
#customize-header-actions img {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
margin-left: 4px;
|
||||
float: right;
|
||||
margin-top: 13px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.saving #customize-footer-actions img {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#customize-footer-actions .button-primary {
|
||||
display: inline-block;
|
||||
margin-top: 12px;
|
||||
.saving #customize-header-actions img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control {
|
||||
|
@ -496,13 +496,8 @@
|
||||
|
||||
// If we receive a 'back' event, we're inside an iframe.
|
||||
// Send any clicks to the 'Return' link to the parent page.
|
||||
parent.bind( 'back', function( text ) {
|
||||
var back = $('.back');
|
||||
|
||||
if ( text )
|
||||
back.text( text );
|
||||
|
||||
back.on( 'click.back', function( event ) {
|
||||
parent.bind( 'back', function() {
|
||||
$('.back').on( 'click.back', function( event ) {
|
||||
event.preventDefault();
|
||||
parent.send( 'close' );
|
||||
});
|
||||
|
@ -69,7 +69,7 @@ if ( typeof wp === 'undefined' )
|
||||
|
||||
// Wait for the connection from the iframe before sending any postMessage events.
|
||||
this.messenger.bind( 'ready', function() {
|
||||
Loader.messenger.send( 'back', wpCustomizeLoaderL10n.back || '' );
|
||||
Loader.messenger.send( 'back' );
|
||||
});
|
||||
|
||||
this.messenger.bind( 'close', function() {
|
||||
|
@ -1589,12 +1589,9 @@ add_action( 'plugins_loaded', '_wp_customize_include' );
|
||||
* @since 3.4.0
|
||||
*/
|
||||
function _wp_customize_loader_localize() {
|
||||
$l10n = array( 'url' => admin_url( 'admin.php' ) );
|
||||
|
||||
if ( is_admin() )
|
||||
$l10n[ 'back' ] = sprintf( __( '← Return to %s' ), get_admin_page_title() );
|
||||
|
||||
wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', $l10n );
|
||||
wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', array(
|
||||
'url' => admin_url( 'admin.php' ),
|
||||
) );
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user