Themes: Avoid a JS error in the keyup event handler when the overlay is not yet initialized.
fixes #26497. git-svn-id: https://develop.svn.wordpress.org/trunk@26826 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8a3b39e1a6
commit
98824e94de
@ -390,6 +390,10 @@ themes.view.Themes = wp.Backbone.View.extend({
|
||||
|
||||
// Bind keyboard events.
|
||||
$('body').on( 'keyup', function( event ) {
|
||||
if ( ! self.overlay ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pressing the right arrow key fires a theme:next event
|
||||
if ( event.keyCode === 39 ) {
|
||||
self.overlay.nextTheme();
|
||||
|
Loading…
x
Reference in New Issue
Block a user