UI Project: Show sidebar by default.

Change the logic to hide, instead.
This commit is contained in:
Pablo Vazquez 2019-03-29 15:47:21 +01:00
parent 77a7b15a73
commit 1d476d03d7
2 changed files with 17 additions and 13 deletions

View File

@ -100,38 +100,39 @@ function containerResizeY(window_height){
}; };
function loadProjectSidebar(){ function loadProjectSidebar(){
var bcloud_ui = Cookies.getJSON('bcloud_ui'); var bcloud_ui = Cookies.getJSON('bcloud_ui');
if (bcloud_ui && bcloud_ui.show_project_sidebar) { if (bcloud_ui && bcloud_ui.hide_project_sidebar) {
showProjectSidebar();
} else {
hideProjectSidebar(); hideProjectSidebar();
} else {
showProjectSidebar();
}; };
} }
function showProjectSidebar(){ function showProjectSidebar(){
setJSONCookie('bcloud_ui', 'show_project_sidebar', true); Cookies.remove('bcloud_ui', 'hide_project_sidebar');
$('#project-container').addClass('is-sidebar-visible'); $('#project-container').addClass('is-sidebar-visible');
$('#project-side-container').removeClass('d-none');
// Hide the toggle button.
$('.breadcrumbs-container .project-sidebar-toggle').hide(); $('.breadcrumbs-container .project-sidebar-toggle').hide();
} }
function hideProjectSidebar(){ function hideProjectSidebar(){
Cookies.remove('bcloud_ui', 'show_project_sidebar'); setJSONCookie('bcloud_ui', 'hide_project_sidebar', true);
$('#project-container').removeClass('is-sidebar-visible'); $('#project-container').removeClass('is-sidebar-visible');
$('#project-side-container').addClass('d-none');
// Show the toggle button.
$('.breadcrumbs-container .project-sidebar-toggle').show(); $('.breadcrumbs-container .project-sidebar-toggle').show();
} }
function toggleProjectSidebar(){ function toggleProjectSidebar(){
let $projectSidebar = $('#project-side-container'); let $projectContainer = $('#project-container');
if ($projectSidebar.hasClass('d-none')) { if ($projectContainer.hasClass('is-sidebar-visible')) {
showProjectSidebar();
} else {
hideProjectSidebar(); hideProjectSidebar();
} else {
showProjectSidebar();
}; };
} }

View File

@ -17,6 +17,9 @@ body.svnman, body.edit_node_types, body.search-project
z-index: $z-index-base z-index: $z-index-base
&.is-sidebar-visible &.is-sidebar-visible
#project-side-container
@extend .d-flex
.breadcrumbs-container .breadcrumbs-container
+media-xs +media-xs
left: $project_nav-width-xs left: $project_nav-width-xs
@ -30,7 +33,7 @@ body.svnman, body.edit_node_types, body.search-project
left: $project_nav-width-xl left: $project_nav-width-xl
#project-side-container #project-side-container
display: flex display: none
+media-xs +media-xs
position: fixed position: fixed