This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
2012-02-02 20:49:40 +00:00
|
|
|
jQuery( document ).ready( function( $ ) {
|
|
|
|
$( document ).keydown( function( e ) {
|
|
|
|
var url = false;
|
2013-07-14 06:38:08 +00:00
|
|
|
if ( e.which === 37 ) { // Left arrow key code
|
2013-08-27 09:29:46 +00:00
|
|
|
url = $( '.nav-previous a' ).attr( 'href' );
|
2012-02-02 20:49:40 +00:00
|
|
|
}
|
2013-07-14 06:38:08 +00:00
|
|
|
else if ( e.which === 39 ) { // Right arrow key code
|
2012-02-03 14:02:28 +00:00
|
|
|
url = $( '.entry-attachment a' ).attr( 'href' );
|
2012-02-02 20:49:40 +00:00
|
|
|
}
|
2013-10-01 05:32:42 +00:00
|
|
|
if ( url && ( ! $( 'textarea, input' ).is( ':focus' ) ) ) {
|
2012-02-02 20:49:40 +00:00
|
|
|
window.location = url;
|
|
|
|
}
|
|
|
|
} );
|
2013-07-14 06:38:08 +00:00
|
|
|
} );
|