right/left arrow keys functional on photo#show
This commit is contained in:
parent
30dd11b9fa
commit
0fb102a2ec
3 changed files with 16 additions and 5 deletions
|
|
@ -8,9 +8,9 @@
|
||||||
.span-15.append-1.last
|
.span-15.append-1.last
|
||||||
#photo_controls
|
#photo_controls
|
||||||
.right
|
.right
|
||||||
=link_to "← #{t('previous')}", @prev_photo, :rel => 'prefetch'
|
=link_to "← #{t('previous')}", @prev_photo, :rel => 'prefetch', :id => 'photo_show_left'
|
||||||
\/
|
\/
|
||||||
=link_to "#{t('next')} →", @next_photo, :rel => 'prefetch'
|
=link_to "#{t('next')} →", @next_photo, :rel => 'prefetch', :id => 'photo_show_right'
|
||||||
|
|
||||||
- if @photo.status_message_id
|
- if @photo.status_message_id
|
||||||
=link_to "← #{t('.view_original_post')}", @photo.status_message
|
=link_to "← #{t('.view_original_post')}", @photo.status_message
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ $(document).ready( function(){
|
||||||
$("#show_photo").find("img").fadeTo(200,1);
|
$("#show_photo").find("img").fadeTo(200,1);
|
||||||
$("#photo_spinner").hide();
|
$("#photo_spinner").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.edit_photo').bind('ajax:success', function(data, json, xhr) {
|
$('.edit_photo').bind('ajax:success', function(data, json, xhr) {
|
||||||
json = $.parseJSON(json);
|
json = $.parseJSON(json);
|
||||||
$(".edit_photo input[type='text']").val(json['photo']['caption']);
|
$(".edit_photo input[type='text']").val(json['photo']['caption']);
|
||||||
|
|
@ -58,4 +58,17 @@ $(document).ready( function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// right/left hotkeys
|
||||||
|
$(document).keyup(function(e){
|
||||||
|
//left
|
||||||
|
if(e.keyCode == 37) {
|
||||||
|
document.location = $("#photo_show_left").attr('href');
|
||||||
|
|
||||||
|
//right
|
||||||
|
} else if(e.keyCode == 39) {
|
||||||
|
document.location = $("#photo_show_right").attr('href');
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -302,8 +302,6 @@ li.message
|
||||||
:color #777
|
:color #777
|
||||||
|
|
||||||
.from
|
.from
|
||||||
:margin
|
|
||||||
:bottom 5px
|
|
||||||
h4
|
h4
|
||||||
:display inline
|
:display inline
|
||||||
a
|
a
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue