Theme Installer: Left/right arrow keys in the overlay.

props adamsilverstein.
see #27521.


git-svn-id: https://develop.svn.wordpress.org/trunk@28036 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-04-08 04:12:44 +00:00
parent 1478afb236
commit 62b57b3b1f

View File

@ -756,10 +756,19 @@ themes.view.Preview = themes.view.Details.extend({
$( 'body' )
.addClass( 'theme-installer-active full-overlay-active' )
.on( 'keyup.overlay', function( event ) {
// Pressing the escape key closes the preview
// The escape key closes the preview
if ( event.keyCode === 27 ) {
self.close();
}
// The right arrow key, next theme
if ( event.keyCode === 39 ) {
self.nextTheme();
}
// The left arrow key, previous theme
if ( event.keyCode === 37 ) {
self.previousTheme();
}
});
$( '.close-full-overlay' ).focus();
});