UX: Apply the category class on initial page load
This commit is contained in:
parent
6129fda8af
commit
72560b5260
|
@ -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…
Reference in New Issue