diff -r c7c34916027a -r 177826044cd9 wp/wp-admin/js/theme.js --- a/wp/wp-admin/js/theme.js Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-admin/js/theme.js Mon Oct 14 18:28:13 2019 +0200 @@ -1,4 +1,8 @@ -/* global _wpThemeSettings, confirm */ +/** + * @output wp-admin/js/theme.js + */ + +/* global _wpThemeSettings, confirm, tb_position */ window.wp = window.wp || {}; ( function($) { @@ -334,18 +338,7 @@ data: { // Request data request: _.extend({ - per_page: 100, - fields: { - description: true, - tested: true, - requires: true, - rating: true, - downloaded: true, - downloadLink: true, - last_updated: true, - homepage: true, - num_ratings: true - } + per_page: 100 }, request) }, @@ -584,16 +577,26 @@ // Handles .disabled classes for previous/next buttons in theme installer preview setNavButtonsState: function() { var $themeInstaller = $( '.theme-install-overlay' ), - current = _.isUndefined( this.current ) ? this.model : this.current; + current = _.isUndefined( this.current ) ? this.model : this.current, + previousThemeButton = $themeInstaller.find( '.previous-theme' ), + nextThemeButton = $themeInstaller.find( '.next-theme' ); // Disable previous at the zero position if ( 0 === this.model.collection.indexOf( current ) ) { - $themeInstaller.find( '.previous-theme' ).addClass( 'disabled' ); + previousThemeButton + .addClass( 'disabled' ) + .prop( 'disabled', true ); + + nextThemeButton.focus(); } // Disable next if the next model is undefined if ( _.isUndefined( this.model.collection.at( this.model.collection.indexOf( current ) + 1 ) ) ) { - $themeInstaller.find( '.next-theme' ).addClass( 'disabled' ); + nextThemeButton + .addClass( 'disabled' ) + .prop( 'disabled', true ); + + previousThemeButton.focus(); } }, @@ -2038,9 +2041,8 @@ })( jQuery ); // Align theme browser thickbox -var tb_position; jQuery(document).ready( function($) { - tb_position = function() { + window.tb_position = function() { var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(),