From 3c044eba6fb0025bb2ea8e9cd44b5808f7fb6182 Mon Sep 17 00:00:00 2001 From: koopersmith Date: Fri, 25 May 2012 22:43:11 +0000 Subject: [PATCH] Theme Customizer: Correctly use custom-background class in theme preview. See #19910. git-svn-id: http://core.svn.wordpress.org/trunk@20919 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/customize-preview.dev.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/wp-includes/js/customize-preview.dev.js b/wp-includes/js/customize-preview.dev.js index 6d2540f90..36c4a6a85 100644 --- a/wp-includes/js/customize-preview.dev.js +++ b/wp-includes/js/customize-preview.dev.js @@ -81,15 +81,28 @@ }); api.when.apply( api, bg ).done( function( color, image, position_x, repeat, attachment ) { - var style = $('#custom-background-css'), + var body = $(document.body), + style = $('#custom-background-css'), update; - if ( ! style.length ) + // If custom backgrounds are active and we can't find the + // default output, bail. + if ( body.hasClass('custom-background') && ! style.length ) return; + // Create the CSS container if it doesn't already exist. + if ( ! style.length ) + style = $('