Edit File by line
/home/barbar84/public_h.../wp-conte.../themes/twentyni.../js
File: customize-preview.js
/**
[0] Fix | Delete
* File customize-preview.js.
[1] Fix | Delete
*
[2] Fix | Delete
* Theme Customizer enhancements for a better user experience.
[3] Fix | Delete
*
[4] Fix | Delete
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
(function( $ ) {
[8] Fix | Delete
[9] Fix | Delete
// Primary color.
[10] Fix | Delete
wp.customize( 'primary_color', function( value ) {
[11] Fix | Delete
value.bind( function( to ) {
[12] Fix | Delete
// Update custom color CSS.
[13] Fix | Delete
var style = $( '#custom-theme-colors' ),
[14] Fix | Delete
hue = style.data( 'hue' ),
[15] Fix | Delete
css = style.html(),
[16] Fix | Delete
color;
[17] Fix | Delete
[18] Fix | Delete
if( 'custom' === to ){
[19] Fix | Delete
// If a custom primary color is selected, use the currently set primary_color_hue.
[20] Fix | Delete
color = wp.customize.get().primary_color_hue;
[21] Fix | Delete
} else {
[22] Fix | Delete
// If the "default" option is selected, get the default primary_color_hue.
[23] Fix | Delete
color = 199;
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
// Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed.
[27] Fix | Delete
css = css.split( hue + ',' ).join( color + ',' );
[28] Fix | Delete
style.html( css ).data( 'hue', color );
[29] Fix | Delete
});
[30] Fix | Delete
});
[31] Fix | Delete
[32] Fix | Delete
// Primary color hue.
[33] Fix | Delete
wp.customize( 'primary_color_hue', function( value ) {
[34] Fix | Delete
value.bind( function( to ) {
[35] Fix | Delete
[36] Fix | Delete
// Update custom color CSS.
[37] Fix | Delete
var style = $( '#custom-theme-colors' ),
[38] Fix | Delete
hue = style.data( 'hue' ),
[39] Fix | Delete
css = style.html();
[40] Fix | Delete
[41] Fix | Delete
// Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed.
[42] Fix | Delete
css = css.split( hue + ',' ).join( to + ',' );
[43] Fix | Delete
style.html( css ).data( 'hue', to );
[44] Fix | Delete
});
[45] Fix | Delete
});
[46] Fix | Delete
[47] Fix | Delete
// Image filter.
[48] Fix | Delete
wp.customize( 'image_filter', function( value ) {
[49] Fix | Delete
value.bind( function( to ) {
[50] Fix | Delete
if ( to ) {
[51] Fix | Delete
$( 'body' ).addClass( 'image-filters-enabled' );
[52] Fix | Delete
} else {
[53] Fix | Delete
$( 'body' ).removeClass( 'image-filters-enabled' );
[54] Fix | Delete
}
[55] Fix | Delete
} );
[56] Fix | Delete
} );
[57] Fix | Delete
[58] Fix | Delete
})( jQuery );
[59] Fix | Delete
[60] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function