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:
Weston Ruter
2016-11-15 03:46:14 +00:00
parent f62112fa16
commit c03e8cd51c
2 changed files with 30 additions and 2 deletions
+20
View File
@@ -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( {