mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-19 00:55:13 +01:00
f3f84d2f21
* Introduces `customize-selective-refresh-widgets` theme support feature and adds to themes. * Introduces `customize_selective_refresh` arg for `WP_Widget::$widget_options` and adds to all core widgets. * Remove `selective_refresh` from being a component that can be removed via `customize_loaded_components` filter. * Add `WP_Customize_Widgets::get_selective_refreshable_widgets()` and `WP_Customize_Widgets::is_widget_selective_refreshable()`. * Fix default `selector` for `Partial` instances. * Implement and improve Masronry sidebar refresh logic in Twenty Thirteen and Twenty Fourteen, including preservation of initial widget position after refresh. * Re-initialize ME.js when refreshing `Twenty_Fourteen_Ephemera_Widget`. See #27355. Fixes #35855. Built from https://develop.svn.wordpress.org/trunk@37040 git-svn-id: http://core.svn.wordpress.org/trunk@37007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/**
|
|
* Customizer enhancements for a better user experience.
|
|
*
|
|
* Contains handlers to make Customizer preview reload changes asynchronously.
|
|
* Things like site title and description changes.
|
|
*/
|
|
|
|
( function( $ ) {
|
|
// Site title and description.
|
|
wp.customize( 'blogname', function( value ) {
|
|
value.bind( function( to ) {
|
|
$( '.site-title' ).text( to );
|
|
} );
|
|
} );
|
|
wp.customize( 'blogdescription', function( value ) {
|
|
value.bind( function( to ) {
|
|
$( '.site-description' ).text( to );
|
|
} );
|
|
} );
|
|
// Header text color.
|
|
wp.customize( 'header_textcolor', function( value ) {
|
|
value.bind( function( to ) {
|
|
if ( 'blank' == to ) {
|
|
if ( 'remove-header' == wp.customize.instance( 'header_image' ).get() ) {
|
|
$( '.home-link' ).css( 'min-height', '0' );
|
|
}
|
|
$( '.site-title, .site-description' ).css( {
|
|
'clip': 'rect(1px, 1px, 1px, 1px)',
|
|
'position': 'absolute'
|
|
} );
|
|
} else {
|
|
$( '.home-link' ).css( 'min-height', '230px' );
|
|
$( '.site-title, .site-description' ).css( {
|
|
'clip': 'auto',
|
|
'color': to,
|
|
'position': 'relative'
|
|
} );
|
|
}
|
|
} );
|
|
} );
|
|
} )( jQuery );
|