$(function() {
  $(document).on('keyup', function(event) {
    var $panel          = $('.snapshot-review-panel'),
        $activeSnapshot = $panel.find('.snapshot-card-active'),
        $goTo;
    if (event.which == 37) { // Left arrow
      $goTo = $activeSnapshot.prev();
    } else if (event.which == 39) { // Right arrow
      $goTo = $activeSnapshot.next();
    } else {
      return;
    }

    if ($goTo.length) {
      Turbolinks.visit($goTo.find('a').first().attr('href'));
    }
  });
});

$(function() {
  $(document).on('keyup', function(event) {
    var $panel          = $('.snapshot-review-panel'),
        $activeSnapshot = $panel.find('.snapshot-card-active'),
        $goTo;
    if (event.which == 37) { // Left arrow
      $goTo = $activeSnapshot.prev();
    } else if (event.which == 39) { // Right arrow
      $goTo = $activeSnapshot.next();
    } else {
      return;
    }

    if ($goTo.length) {
      Turbolinks.visit($goTo.attr('href'));
    }
  });
});

Fix keyboard navigation on snapshot page
Fix keyboard navigation on snapshot page

Commit 0843a604ba made the entire snapshot card clickable (awesome!) but
unfortunately broke keyboard navigation on the snapshot page. I can't
blame anyone, the js is fragile for DOM changes. We should probably
introduce some js (Jasmine?) specs, but I'll wait some more for that.
