Make WordPress Core

Ticket #27521: 27521.9.diff

File 27521.9.diff, 733 bytes (added by helen, 10 years ago)
  • src/wp-admin/js/theme.js

     
    332332
    333333                preview.render();
    334334                $( 'div.wrap' ).append( preview.el );
     335
     336                // Set focused theme to current element
     337                themes.focusedTheme = this.$el;
     338
     339                // set focus in the preview
     340                $( '.close-full-overlay' ).focus();
    335341        }
    336342});
    337343
     
    528534                        $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' );
    529535                });
    530536
     537                // Return focus to the theme div
     538                if ( themes.focusedTheme ) {
     539                        themes.focusedTheme.focus();
     540                }
     541
    531542                themes.router.navigate( themes.router.baseUrl( '' ) );
    532543                return false;
    533544        },