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:
Andrew Nacin 2013-12-09 07:07:10 +00:00
parent f70e3595b8
commit 2530fbbfba
2 changed files with 5 additions and 1 deletions

View File

@ -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();

File diff suppressed because one or more lines are too long