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
This commit is contained in:
Lance Willett 2012-08-25 17:47:34 +00:00
parent 8089a0683e
commit 3364eba1f0
1 changed files with 3 additions and 4 deletions

View File

@ -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 );