Commit 625b0bcf authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Remove JS flicker on page load; UI tweaks

parent b12107a0
...@@ -45,8 +45,10 @@ export default class NewNavSidebar { ...@@ -45,8 +45,10 @@ export default class NewNavSidebar {
toggleCollapsedSidebar(collapsed) { toggleCollapsedSidebar(collapsed) {
this.$sidebar.toggleClass('sidebar-icons-only', collapsed); this.$sidebar.toggleClass('sidebar-icons-only', collapsed);
if (this.$sidebar.length) {
this.$page.toggleClass('page-with-new-sidebar', !collapsed); this.$page.toggleClass('page-with-new-sidebar', !collapsed);
this.$page.toggleClass('page-with-icon-sidebar', collapsed); this.$page.toggleClass('page-with-icon-sidebar', collapsed);
}
NewNavSidebar.setCollapsedCookie(collapsed); NewNavSidebar.setCollapsedCookie(collapsed);
} }
......
...@@ -400,6 +400,7 @@ $new-sidebar-collapsed-width: 50px; ...@@ -400,6 +400,7 @@ $new-sidebar-collapsed-width: 50px;
.toggle-sidebar-button { .toggle-sidebar-button {
width: $new-sidebar-collapsed-width - 2px; width: $new-sidebar-collapsed-width - 2px;
padding: 16px 18px;
.collapse-text, .collapse-text,
.fa-angle-double-left { .fa-angle-double-left {
......
...@@ -305,4 +305,8 @@ module ApplicationHelper ...@@ -305,4 +305,8 @@ module ApplicationHelper
def show_new_nav? def show_new_nav?
cookies["new_nav"] == "true" cookies["new_nav"] == "true"
end end
def collapsed_sidebar?
cookies["sidebar_collapsed"] == "true"
end
end end
...@@ -2,6 +2,7 @@ module NavHelper ...@@ -2,6 +2,7 @@ module NavHelper
def page_with_sidebar_class def page_with_sidebar_class
class_name = page_gutter_class class_name = page_gutter_class
class_name << 'page-with-new-sidebar' if defined?(@new_sidebar) && @new_sidebar class_name << 'page-with-new-sidebar' if defined?(@new_sidebar) && @new_sidebar
class_name << 'page-with-icon-sidebar' if collapsed_sidebar?
class_name class_name
end end
......
.nav-sidebar .nav-sidebar{ class: ("sidebar-icons-only" if collapsed_sidebar?) }
- can_edit = can?(current_user, :admin_project, @project) - can_edit = can?(current_user, :admin_project, @project)
.context-header .context-header
= link_to project_path(@project), title: @project.name do = link_to project_path(@project), title: @project.name do
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
= link_to project_settings_members_path(@project), title: 'Members', class: 'shortcuts-tree' do = link_to project_settings_members_path(@project), title: 'Members', class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= custom_icon('members') = custom_icon('members')
%span %span.nav-item-name
Members Members
= render 'shared/sidebar_toggle_button' = render 'shared/sidebar_toggle_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