<% if logged_in? %>
<%= render 'layouts/menu_user' -%>
<% else %>
- <li><a href="<%= ApplicationController.root_context -%>/sessions/new?return_to=<%= u (request.request_uri) -%>"><%= message('layout.login') -%></a></li>
+ <li><a id="login-link" href="<%= ApplicationController.root_context -%>/sessions/new?return_to=<%= u (request.request_uri) -%>"><%= message('layout.login') -%></a></li>
<% end %>
<% if is_admin? %>
<li><a href="<%= ApplicationController.root_context -%>/settings/index" class="<%= 'selected' if selected_section==Navigation::SECTION_CONFIGURATION -%>"><%= message('layout.settings') -%></a></li>
jQuery(function() {
+
+ // Initialize top search
jQuery('#searchInput').topSearch({
minLength: 2,
results: '#searchResourcesResults',
spinner: '#searchingResources'
});
+
+
+ // Process login link in order to add the anchor
+ jQuery('#login-link').on('click', function(e) {
+ e.preventDefault();
+ var href = jQuery(this).prop('href'),
+ hash = window.location.hash;
+ if (hash.length > 0) {
+ href += decodeURIComponent(hash);
+ }
+ window.location = href;
+ });
});
+