Commit 868f9ba4673c3f5f1f68f07baba9304368371e5e
1 parent
df87b54e
Exists in
master
and in
29 other branches
Restore adding of CSS class for logged-in users
This time via Javascript since all HTML is (potentially) cached. Thanks to Aurélio Heckert for pointing it out. (ActionItem1608)
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/views/layouts/application.rhtml
... | ... | @@ -37,8 +37,7 @@ |
37 | 37 | <body class='noosfero category<%= category_color %><%= |
38 | 38 | # Identify the current controller and action for the CSS: |
39 | 39 | " controller-"+ @controller.controller_name() + |
40 | - " action_"+ @controller.controller_name() +"_"+ @controller.action_name() + | |
41 | - ' ' + (logged_in? ? 'logged-in' : 'not-logged-in') | |
40 | + " action_"+ @controller.controller_name() +"_"+ @controller.action_name() | |
42 | 41 | %>' onload='noosfero_init();' |
43 | 42 | onresize="registerDocumentSize()"> |
44 | 43 | <script type="text/javascript"> | ... | ... |
public/javascripts/application.js
... | ... | @@ -448,6 +448,7 @@ jQuery(function($) { |
448 | 448 | $.getJSON('/account/user_data', function(data) { |
449 | 449 | if (data.login) { |
450 | 450 | // logged in |
451 | + $('body').addClass('logged-in'); | |
451 | 452 | $('#user .logged-in, .login-block .logged-user-info').each(function() { |
452 | 453 | $(this).find('a[href]').each(function() { |
453 | 454 | var new_href = $(this).attr('href').replace('%{login}', data.login); | ... | ... |