From fe877734468a15cbf0d8e159f35ef16f8d5eab01 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sat, 25 Aug 2012 17:47:34 +0000 Subject: [PATCH] Twenty Twelve: JavaScript fix props obenland; no need to put the selector in a variable as it will be called only once anyway. See #21685. git-svn-id: http://core.svn.wordpress.org/trunk@21622 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwelve/js/theme-customizer.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-content/themes/twentytwelve/js/theme-customizer.js b/wp-content/themes/twentytwelve/js/theme-customizer.js index 4460812b9c..cbf524b6b4 100644 --- a/wp-content/themes/twentytwelve/js/theme-customizer.js +++ b/wp-content/themes/twentytwelve/js/theme-customizer.js @@ -33,14 +33,13 @@ // Hook into background color change and adjust body class value as needed. wp.customize( 'background_color', function( value ) { - var body = $( 'body' ); value.bind( function( to ) { if ( '#ffffff' == to || '#fff' == to || '' == to ) - body.addClass( 'custom-background-white' ); + $( 'body' ).addClass( 'custom-background-white' ); else if ( '' == to ) - body.addClass( 'custom-background-empty' ); + $( 'body' ).addClass( 'custom-background-empty' ); else - body.removeClass( 'custom-background-empty custom-background-white' ); + $( 'body' ).removeClass( 'custom-background-empty custom-background-white' ); } ); } ); } )( jQuery ); \ No newline at end of file