diff -r c7c34916027a -r 177826044cd9 wp/wp-admin/js/custom-header.js --- a/wp/wp-admin/js/custom-header.js Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-admin/js/custom-header.js Mon Oct 14 18:28:13 2019 +0200 @@ -1,12 +1,25 @@ +/** + * @output wp-admin/js/custom-header.js + */ + /* global isRtl */ + +/** + * Initializes the custom header selection page. + * + * @since 3.5.0 + * + * @deprecated 4.1.0 The page this is used on is never linked to from the UI. + * Setting a custom header is completely handled by the Customizer. + */ (function($) { var frame; $( function() { - // Fetch available headers and apply jQuery.masonry - // once the images have loaded. + // Fetch available headers. var $headers = $('.available-headers'); + // Apply jQuery.masonry once the images have loaded. $headers.imagesLoaded( function() { $headers.masonry({ itemSelector: '.default-header', @@ -14,7 +27,14 @@ }); }); - // Build the choose from library frame. + /** + * Opens the 'choose from library' frame and creates it if it doesn't exist. + * + * @since 3.5.0 + * @deprecated 4.1.0 + * + * @returns {void} + */ $('#choose-from-library-link').click( function( event ) { var $el = $(this); event.preventDefault(); @@ -45,7 +65,14 @@ } }); - // When an image is selected, run a callback. + /** + * Updates the window location to include the selected attachment. + * + * @since 3.5.0 + * @deprecated 4.1.0 + * + * @returns {void} + */ frame.on( 'select', function() { // Grab the selected attachment. var attachment = frame.state().get('selection').first(),