mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-01 09:39:51 -04:00
UX: Apply the category class on initial page load
This commit is contained in:
parent
6129fda8af
commit
72560b5260
2 changed files with 7 additions and 1 deletions
app
|
@ -59,6 +59,12 @@ module ApplicationHelper
|
|||
"#{mobile_view? ? 'mobile-view' : 'desktop-view'} #{mobile_device? ? 'mobile-device' : 'not-mobile-device'} #{rtl_class} #{current_user ? '' : 'anon'}"
|
||||
end
|
||||
|
||||
def body_classes
|
||||
if @category && @category.url.present?
|
||||
"category-#{@category.url.sub(/^\/c\//, '').gsub(/\//, '-')}"
|
||||
end
|
||||
end
|
||||
|
||||
def rtl_class
|
||||
rtl? ? 'rtl' : ''
|
||||
end
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<%= yield :head %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body class="<%= body_classes %>">
|
||||
<div class='debug-eyeline'></div>
|
||||
|
||||
<noscript data-path="<%= request.env['PATH_INFO'] %>">
|
||||
|
|
Loading…
Add table
Reference in a new issue