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 :javascript
$(function(){ $(function(){
$(document).keypress(function(event){ $(document).keypress(function(event){
console.log(event.which);
$('#text').focus(); $('#text').focus();
$('#comment').modal(); $('#comment').modal();
$('#text').focus(); $('#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 #post-author-header
@ -23,8 +38,8 @@
#post-content #post-content
= link_to image_tag('arrow-left.png'), post_path(@post.id-1), :class => 'nav-arrow left' = 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' = link_to image_tag('arrow-right.png'), post_path(@post.id+1), :class => 'nav-arrow right', :id => 'forward'
#comment.modal.fade #comment.modal.fade
.modal-body .modal-body