<td align="center">
<div id="login_form">
<form action="<%= url_for :controller => 'sessions', :action => 'login' -%>" method="post">
- <input type="hidden" name="return_to_anchor" value="">
+ <input type="hidden" name="return_to_anchor" value="<%= @return_to_anchor %>">
<h3><%= label_tag message('login') %></h3>
<p>
<%= text_field_tag 'login', '', {:maxlength => 255, :disabled => false, :style => 'width:200px;'} %>
</table>
<script>
$j('#login').focus();
- $j('[name=return_to_anchor]').val(window.location.hash);
+ if (!$j('[name=return_to_anchor]').val()) {
+ $j('[name=return_to_anchor]').val(window.location.hash);
+ }
</script>