1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-26 10:21:14 +00:00

Keep anchor (i.e. to a specific issue note) throughout login (#21110).

Patch by Jens Krämer.

git-svn-id: http://svn.redmine.org/redmine/trunk@14767 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2015-10-30 11:00:32 +00:00
parent f29aa17f1b
commit 27b65d53ac
2 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<%= call_hook :view_account_login_top %>
<div id="login-form">
<%= form_tag(signin_path) do %>
<%= form_tag(signin_path, onsubmit: 'return keepAnchorOnSignIn(this);') do %>
<%= back_url_hidden_field_tag %>
<table>
<tr>

View File

@ -651,6 +651,17 @@ $(document).ready(function(){
toggleDisabledInit();
});
function keepAnchorOnSignIn(form){
var hash = decodeURIComponent(self.document.location.hash);
if (hash) {
if (hash.indexOf("#") === -1) {
hash = "#" + hash;
}
form.action = form.action + hash;
}
return true;
}
$(document).ready(setupAjaxIndicator);
$(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit);