Fixes the broken display header text option in the Customizer.

This commit is contained in:
Takashi Irie 2013-04-22 16:47:14 +01:00
parent 790b765ac2
commit 8ceefdcdeb
3 changed files with 16 additions and 10 deletions

View File

@ -105,7 +105,7 @@ function _s_header_style() {
?>
.site-title,
.site-description {
position: absolute !important;
position: absolute;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
@ -159,12 +159,7 @@ if ( ! function_exists( '_s_admin_header_image' ) ) :
*/
function _s_admin_header_image() { ?>
<div id="headimg">
<?php
if ( 'blank' == get_header_textcolor() || '' == get_header_textcolor() )
$style = ' style="display:none;"';
else
$style = ' style="color:#' . get_header_textcolor() . ';"';
?>
<?php $style = ' style="color:#' . get_header_textcolor() . ';"'; ?>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div class="displaying-header-text" id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
<?php $header_image = get_header_image();

View File

@ -21,6 +21,6 @@ add_action( 'customize_register', '_s_customize_register' );
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function _s_customize_preview_js() {
wp_enqueue_script( '_s_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130304', true );
wp_enqueue_script( '_s_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130422', true );
}
add_action( 'customize_preview_init', '_s_customize_preview_js' );

View File

@ -8,7 +8,7 @@
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
$( '.site-title' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
@ -19,7 +19,18 @@
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
$( '.site-title a, .site-description' ).css( 'color', to );
if ( 'blank' == to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'color': to,
'position': 'relative'
} );
}
} );
} );
} )( jQuery );