Fix layout overflow when navigator is open [SCI-8589]

This commit is contained in:
Martin Artnik 2023-06-01 12:14:27 +02:00
parent d4fb499a17
commit 673c1fbaa8
3 changed files with 9 additions and 1 deletions

View file

@ -1,4 +1,8 @@
body {
min-width: 1140px;
}
body.navigator-collapsed {
min-width: 900px;
}

View file

@ -46,7 +46,11 @@ window.addEventListener('DOMContentLoaded', () => {
navigatorCollapsed: function () {
let stateUrl = $('#sciNavigationNavigatorContainer').attr('data-navigator-state-url');
$('.sci--layout').attr('data-navigator-collapsed', this.navigatorCollapsed);
$('body').toggleClass('navigator-collapsed', this.navigatorCollapsed);
$.post(stateUrl, {state: this.navigatorCollapsed ? 'collapsed' : 'open'});
// refresh action toolbar width on navigator toggle, take into account transition time of .4s
if (window.actionToolbarComponent) setTimeout(window.actionToolbarComponent.setWidth, 401);
}
}
});

View file

@ -49,7 +49,7 @@
<%= javascript_include_tag 'vue_navigation_top_menu', nonce: true %>
</head>
<body
class="<%= yield :body_class %>"
class="<%= yield :body_class %> <%= 'navigator-collapsed' if !@navigator || session[:navigator_collapsed] %>"
<% if user_signed_in? && current_team.present? %>
data-current-team-id="<%= current_team.id %>"
data-atwho-users-url="<%= atwho_users_team_path(current_team) %>"