diff --git a/src/scripts/tutti/1_project-navigation.js b/src/scripts/tutti/1_project-navigation.js index a39dd19b..32d7b423 100644 --- a/src/scripts/tutti/1_project-navigation.js +++ b/src/scripts/tutti/1_project-navigation.js @@ -100,38 +100,39 @@ function containerResizeY(window_height){ }; function loadProjectSidebar(){ - var bcloud_ui = Cookies.getJSON('bcloud_ui'); - if (bcloud_ui && bcloud_ui.show_project_sidebar) { - showProjectSidebar(); - } else { + if (bcloud_ui && bcloud_ui.hide_project_sidebar) { hideProjectSidebar(); + } else { + showProjectSidebar(); }; } function showProjectSidebar(){ - setJSONCookie('bcloud_ui', 'show_project_sidebar', true); + Cookies.remove('bcloud_ui', 'hide_project_sidebar'); $('#project-container').addClass('is-sidebar-visible'); - $('#project-side-container').removeClass('d-none'); + + // Hide the toggle button. $('.breadcrumbs-container .project-sidebar-toggle').hide(); } function hideProjectSidebar(){ - Cookies.remove('bcloud_ui', 'show_project_sidebar'); + setJSONCookie('bcloud_ui', 'hide_project_sidebar', true); $('#project-container').removeClass('is-sidebar-visible'); - $('#project-side-container').addClass('d-none'); + + // Show the toggle button. $('.breadcrumbs-container .project-sidebar-toggle').show(); } function toggleProjectSidebar(){ - let $projectSidebar = $('#project-side-container'); + let $projectContainer = $('#project-container'); - if ($projectSidebar.hasClass('d-none')) { - showProjectSidebar(); - } else { + if ($projectContainer.hasClass('is-sidebar-visible')) { hideProjectSidebar(); + } else { + showProjectSidebar(); }; } diff --git a/src/styles/_project.sass b/src/styles/_project.sass index 7380e678..861cb46c 100644 --- a/src/styles/_project.sass +++ b/src/styles/_project.sass @@ -17,6 +17,9 @@ body.svnman, body.edit_node_types, body.search-project z-index: $z-index-base &.is-sidebar-visible + #project-side-container + @extend .d-flex + .breadcrumbs-container +media-xs left: $project_nav-width-xs @@ -30,7 +33,7 @@ body.svnman, body.edit_node_types, body.search-project left: $project_nav-width-xl #project-side-container - display: flex + display: none +media-xs position: fixed