Themes: Avoid a JS error in the keyup event handler when the overlay is not yet initialized.
fixes #26497. Built from https://develop.svn.wordpress.org/trunk@26826 git-svn-id: http://core.svn.wordpress.org/trunk@26713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f70e3595b8
commit
2530fbbfba
@ -390,6 +390,10 @@ themes.view.Themes = wp.Backbone.View.extend({
|
|||||||
|
|
||||||
// Bind keyboard events.
|
// Bind keyboard events.
|
||||||
$('body').on( 'keyup', function( event ) {
|
$('body').on( 'keyup', function( event ) {
|
||||||
|
if ( ! self.overlay ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Pressing the right arrow key fires a theme:next event
|
// Pressing the right arrow key fires a theme:next event
|
||||||
if ( event.keyCode === 39 ) {
|
if ( event.keyCode === 39 ) {
|
||||||
self.overlay.nextTheme();
|
self.overlay.nextTheme();
|
||||||
|
2
wp-admin/js/theme.min.js
vendored
2
wp-admin/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user