| 307 | | $( 'body' ).on( 'keyup', function( event ) { |
| 308 | | |
| 309 | | // Pressing the right arrow key fires a theme:next event |
| 310 | | if ( event.keyCode === 39 ) { |
| 311 | | self.trigger( 'theme:next', self.model.cid ); |
| 312 | | } |
| 313 | | |
| 314 | | // Pressing the left arrow key fires a theme:previous event |
| 315 | | if ( event.keyCode === 37 ) { |
| 316 | | self.trigger( 'theme:previous', self.model.cid ); |
| 317 | | } |
| 318 | | |
| 319 | | // Pressing the escape key closes the theme details panel |
| 320 | | if ( event.keyCode === 27 ) { |
| 321 | | self.collapse(); |
| 322 | | } |
| 323 | | }); |
| 324 | | |
| | 392 | |
| | 393 | // Bind keyboard events. |
| | 394 | $('body').on( 'keyup', function( event ) { |
| | 395 | // Pressing the right arrow key fires a theme:next event |
| | 396 | if ( event.keyCode === 39 ) { |
| | 397 | self.overlay.nextTheme(); |
| | 398 | } |
| | 399 | |
| | 400 | // Pressing the left arrow key fires a theme:previous event |
| | 401 | if ( event.keyCode === 37 ) { |
| | 402 | self.overlay.previousTheme(); |
| | 403 | } |
| | 404 | |
| | 405 | // Pressing the escape key fires a theme:collapse event |
| | 406 | if ( event.keyCode === 27 ) { |
| | 407 | self.overlay.collapse(); |
| | 408 | } |
| | 409 | }); |