From 5fd51d540363b047af376f1b8719c8cf564f2728 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 15 Mar 2013 16:42:10 +0000 Subject: [PATCH] Twenty Twelve: fix regression introduced in r23572, allow hide/show of Header Text in Customizer. Fixes #23600. Also remove another `!important` -- and there was much rejoicing. Props SergeyBiryukov and obenland. git-svn-id: https://develop.svn.wordpress.org/trunk@23711 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentytwelve/inc/custom-header.php | 2 +- .../themes/twentytwelve/js/theme-customizer.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/twentytwelve/inc/custom-header.php b/wp-content/themes/twentytwelve/inc/custom-header.php index 37c1d3d778..d91a869e64 100644 --- a/wp-content/themes/twentytwelve/inc/custom-header.php +++ b/wp-content/themes/twentytwelve/inc/custom-header.php @@ -69,7 +69,7 @@ function twentytwelve_header_style() { ?> .site-title, .site-description { - position: absolute !important; + position: absolute; clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); } diff --git a/wp-content/themes/twentytwelve/js/theme-customizer.js b/wp-content/themes/twentytwelve/js/theme-customizer.js index 578ec371f6..bde05d9c51 100644 --- a/wp-content/themes/twentytwelve/js/theme-customizer.js +++ b/wp-content/themes/twentytwelve/js/theme-customizer.js @@ -17,10 +17,22 @@ $( '.site-description' ).text( to ); } ); } ); + // 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-title a, .site-description' ).css( { + 'clip': 'rect(1px, 1px, 1px, 1px)', + 'position': 'absolute' + } ); + } else { + $( '.site-title, .site-title a, .site-description' ).css( { + 'clip': 'auto', + 'color': to, + 'position': 'relative' + } ); + } } ); } );