diff options
author | Phil Hughes <me@iamphill.com> | 2016-06-15 19:23:49 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-06-15 19:23:49 +0300 |
commit | e3529d543225dac3867ba7273cb9b3275c7a097f (patch) | |
tree | b828a37af587e9dfe06a851c0343c056bc64c319 /app/helpers/nav_helper.rb | |
parent | 8bfbafbb6b2166d3709187cf6b1cb7ff5f627d52 (diff) |
Pinned sidebar navigation option
Closes #18542
Diffstat (limited to 'app/helpers/nav_helper.rb')
-rw-r--r-- | app/helpers/nav_helper.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 469accf3142..d53ee3c45df 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -12,10 +12,10 @@ module NavHelper end def page_sidebar_class - if nav_menu_collapsed? - "page-sidebar-collapsed" + if pinned_nav? + "page-sidebar-expanded page-sidebar-pinned" else - "page-sidebar-expanded" + "page-sidebar-collapsed" end end @@ -37,6 +37,13 @@ module NavHelper def nav_header_class class_name = " with-horizontal-nav" if defined?(nav) && nav + + if pinned_nav? + class_name << " header-expanded header-pinned-nav" + else + class_name << " header-collapsed" + end + class_name end @@ -47,4 +54,8 @@ module NavHelper def nav_control_class "nav-control" if current_user end + + def pinned_nav? + cookies[:pin_nav] == 'true' + end end |