Commit 65c4dc19 authored by Robert Speicher's avatar Robert Speicher

Simplify toggle-nav-collapse JS

parent 3d4c2d0b
...@@ -3,12 +3,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) -> ...@@ -3,12 +3,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
collapsed = 'page-sidebar-collapsed' collapsed = 'page-sidebar-collapsed'
expanded = 'page-sidebar-expanded' expanded = 'page-sidebar-expanded'
if $('.page-with-sidebar').hasClass(collapsed) $('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}")
$('.page-with-sidebar').removeClass(collapsed).addClass(expanded) $('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left")
$('.toggle-nav-collapse i').removeClass('fa-angle-right').addClass('fa-angle-left') $.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' })
$.cookie("collapsed_nav", "false", { path: '/' })
else
$('.page-with-sidebar').removeClass(expanded).addClass(collapsed)
$('.toggle-nav-collapse i').removeClass('fa-angle-left').addClass('fa-angle-right')
$.cookie("collapsed_nav", "true", { path: '/' })
) )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment