From 330e97d6633478137e982db2ee6a82b72bdbb56d Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Thu, 20 Nov 2014 17:06:23 +0000 Subject: [PATCH] Twenty Twelve and Thirteen: Use proper way to get customizer settings values. Props obenland, kdoran. Fixes #29577. Built from https://develop.svn.wordpress.org/trunk@30482 git-svn-id: http://core.svn.wordpress.org/trunk@30470 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- functions.php | 2 +- js/theme-customizer.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 38ea36ec7..0b6e180b2 100644 --- a/functions.php +++ b/functions.php @@ -494,6 +494,6 @@ add_action( 'customize_register', 'twentytwelve_customize_register' ); * @since Twenty Twelve 1.0 */ function twentytwelve_customize_preview_js() { - wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130301', true ); + wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20141120', true ); } add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' ); diff --git a/js/theme-customizer.js b/js/theme-customizer.js index 9dc117f6c..8bf094be5 100644 --- a/js/theme-customizer.js +++ b/js/theme-customizer.js @@ -53,12 +53,13 @@ value.bind( function( to ) { var body = $( 'body' ); - if ( '' != to ) + if ( '' !== to ) { body.removeClass( 'custom-background-empty custom-background-white' ); - else if ( 'rgb(255, 255, 255)' == body.css( 'background-color' ) ) + } else if ( 'rgb(255, 255, 255)' === body.css( 'background-color' ) ) { body.addClass( 'custom-background-white' ); - else if ( 'rgb(230, 230, 230)' == body.css( 'background-color' ) && '' == _wpCustomizeSettings.values.background_color ) + } else if ( 'rgb(230, 230, 230)' === body.css( 'background-color' ) && '' === wp.customize.instance( 'background_color' ).get() ) { body.addClass( 'custom-background-empty' ); + } } ); } ); } )( jQuery );