Hide the menu on embedded group pages

This commit is contained in:
Maikel Linke
2017-09-20 16:16:44 +10:00
parent b8a124b99e
commit 10bbc5f9ef
3 changed files with 9 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ class GroupsController < BaseController
def show
enable_embedded_shopfront
@hide_menu = true if @shopfront_layout == 'embedded'
@group = EnterpriseGroup.find_by_permalink(params[:id]) || EnterpriseGroup.find(params[:id])
end
end

View File

@@ -20,4 +20,10 @@ module ApplicationHelper
super
end
end
def body_classes
classes = []
classes << "off-canvas" unless @hide_menu
classes << @shopfront_layout
end
end

View File

@@ -22,7 +22,7 @@
= render "layouts/bugherd_script"
= csrf_meta_tags
%body.off-canvas{class: @shopfront_layout, ng: {app: "Darkswarm"}}
%body{class: body_classes, ng: {app: "Darkswarm"}}
/ [if lte IE 8]
= render partial: "shared/ie_warning"
= javascript_include_tag "iehack"
@@ -39,7 +39,7 @@
.off-canvas-wrap{offcanvas: true}
.inner-wrap
= render "shared/menu/menu"
= render "shared/menu/menu" unless @hide_menu
%section{ role: "main" }
= yield