mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Customize: Only show video header controls if previewing front page; show explanatory notice when controls are hidden.
Also include todo for the `header_video` control's `button_labels`. See #38796. Props westonruter, joemcgill, celloexpressions. Fixes #38778. git-svn-id: https://develop.svn.wordpress.org/trunk@39237 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5284,6 +5284,26 @@
|
||||
} );
|
||||
} );
|
||||
|
||||
// Toggle visibility of Header Video notice when active state change.
|
||||
api.control( 'header_video', function( headerVideoControl ) {
|
||||
headerVideoControl.deferred.embedded.done( function() {
|
||||
var toggleNotice = function() {
|
||||
var section = api.section( headerVideoControl.section() ), notice;
|
||||
if ( ! section ) {
|
||||
return;
|
||||
}
|
||||
notice = section.container.find( '.header-video-not-currently-previewable:first' );
|
||||
if ( headerVideoControl.active.get() ) {
|
||||
notice.stop().slideUp( 'fast' );
|
||||
} else {
|
||||
notice.stop().slideDown( 'fast' );
|
||||
}
|
||||
};
|
||||
toggleNotice();
|
||||
headerVideoControl.active.bind( toggleNotice );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Update the setting validities.
|
||||
api.previewer.bind( 'selective-refresh-setting-validities', function handleSelectiveRefreshedSettingValidities( settingValidities ) {
|
||||
api._handleSettingValidities( {
|
||||
|
||||
Reference in New Issue
Block a user