Commit 4860c4dc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix toggle of sidebar

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 1e7c4a25
...@@ -4,6 +4,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) -> ...@@ -4,6 +4,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
expanded = 'page-sidebar-expanded' expanded = 'page-sidebar-expanded'
$('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}") $('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}")
$('header').toggleClass("header-collapsed header-expanded")
$('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left") $('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left")
$.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' }) $.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' })
) )
...@@ -36,12 +36,6 @@ header { ...@@ -36,12 +36,6 @@ header {
} }
.app_logo { .app_logo {
@media (max-width: $screen-md-max) {
width: 52px;
h3 {
display: none;
}
}
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
margin-bottom: -1px; margin-bottom: -1px;
...@@ -229,3 +223,26 @@ header { ...@@ -229,3 +223,26 @@ header {
right: 35px !important; right: 35px !important;
} }
} }
@media (max-width: $screen-md-max) {
.header-collapsed, .header-expanded {
width: 52px;
h3 {
display: none;
}
}
}
@media(min-width: $screen-md-max) {
.header-collapsed {
width: 52px;
h3 {
display: none;
}
}
.header-expanded {
}
}
...@@ -314,12 +314,4 @@ module ApplicationHelper ...@@ -314,12 +314,4 @@ module ApplicationHelper
profile_key_path(key) profile_key_path(key)
end end
end end
def nav_sidebar_class
if nav_menu_collapsed?
"page-sidebar-collapsed"
else
"page-sidebar-expanded"
end
end
end end
...@@ -2,4 +2,20 @@ module NavHelper ...@@ -2,4 +2,20 @@ module NavHelper
def nav_menu_collapsed? def nav_menu_collapsed?
cookies[:collapsed_nav] == 'true' cookies[:collapsed_nav] == 'true'
end end
def nav_sidebar_class
if nav_menu_collapsed?
"page-sidebar-collapsed"
else
"page-sidebar-expanded"
end
end
def nav_header_class
if nav_menu_collapsed?
"header-collapsed"
else
"header-expanded"
end
end
end end
%header.navbar.navbar-fixed-top.navbar-gitlab %header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
.navbar-inner .navbar-inner
.container .container
%div.app_logo %div.app_logo
......
%header.navbar.navbar-fixed-top.navbar-gitlab %header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
.navbar-inner .navbar-inner
.container .container
%div.app_logo %div.app_logo
= link_to explore_root_path, class: "home" do = link_to explore_root_path, class: "home" do
= brand_header_logo = brand_header_logo
%h3 GitLab
%h1.title= title %h1.title= title
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"} %button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
......
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