haha more arrow controlz

This commit is contained in:
Maxwell Salzberg 2012-02-16 00:00:55 -08:00 committed by danielgrippi
parent e0b29048f4
commit a3e8ced6a1

View file

@ -11,10 +11,25 @@
:javascript
$(function(){
$(document).keypress(function(event){
console.log(event.which);
$('#text').focus();
$('#comment').modal();
$('#text').focus();
});
$(document).keydown(function(e){
console.log(e.keyCode);
if (e.keyCode == 37) {
window.location = $('#back').attr('href');
}else if(e.keyCode == 39) {
window.location = $('#forward').attr('href');
}else{}
});
});
#post-author-header
@ -23,8 +38,8 @@
#post-content
= link_to image_tag('arrow-left.png'), post_path(@post.id-1), :class => 'nav-arrow left'
= link_to image_tag('arrow-right.png'), post_path(@post.id+1), :class => 'nav-arrow right'
= link_to image_tag('arrow-left.png'), post_path(@post.id-1), :class => 'nav-arrow left', :id => 'back'
= link_to image_tag('arrow-right.png'), post_path(@post.id+1), :class => 'nav-arrow right', :id => 'forward'
#comment.modal.fade
.modal-body