diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 654bea892..77ef6da1f 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -7,14 +7,28 @@ $(document).keydown(function(e){ switch(e.keyCode) { case 37: - window.location.replace( "#{url_to_prev(@photo,@album)}" ); + if(flag){//prevent redirect if textarea has focus + window.location.replace( "#{url_to_prev(@photo,@album)}" ); + } break; case 39: - window.location.replace( "#{url_to_next(@photo,@album)}" ); + if(flag){ + window.location.replace( "#{url_to_next(@photo,@album)}" ); + } break; } }); + //asign a flag to determine if textarea has focus + $(document).ready(function(){ + $("textarea").live('focus',function(){ + flag = 0; + }); + $("textarea").live('blur',function(){ + flag = 1; + }); + }); + = content_for :page_title do = link_to "◂ #{@photo.album.name}", @photo.album diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 83b6bfc80..ed7dae38e 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -610,3 +610,6 @@ h1.big_text { #fancybox-close:hover { background-color: transparent; } +#photo_caption{ + margin:auto;} +