Fix screenshot carousel when focused on the carousel control and pressing arrow keys

This commit is contained in:
Scott Erickson 2016-02-24 16:55:18 -08:00
parent f1b046b50e
commit fc800935aa

View file

@ -67,11 +67,14 @@ module.exports = class AboutView extends RootView
@scrollToLink('#contact')
onRightPressed: (event) ->
# Special handling, otherwise after you click the control, keyboard presses move the slide twice
return if event.type is 'keydown' and $(document.activeElement).is('.carousel-control')
if $('#screenshot-lightbox').data('bs.modal')?.isShown
event.preventDefault()
$('#screenshot-carousel').carousel('next')
onLeftPressed: (event) ->
return if event.type is 'keydown' and $(document.activeElement).is('.carousel-control')
if $('#screenshot-lightbox').data('bs.modal')?.isShown
event.preventDefault()
$('#screenshot-carousel').carousel('prev')