Changeset View
Changeset View
Standalone View
Standalone View
swh/web/assets/src/bundles/webapp/webapp-utils.js
Show All 16 Lines | let heights = { | ||||
sidebar: $('.main-sidebar').height(), | sidebar: $('.main-sidebar').height(), | ||||
topbar: $('.swh-top-bar').height() | topbar: $('.swh-top-bar').height() | ||||
}; | }; | ||||
let offset = 10; | let offset = 10; | ||||
$('.content-wrapper').css('min-height', heights.window - heights.topbar - heights.header - heights.footer - offset); | $('.content-wrapper').css('min-height', heights.window - heights.topbar - heights.header - heights.footer - offset); | ||||
$('.main-sidebar').css('min-height', heights.window - heights.topbar - heights.header - heights.footer - offset); | $('.main-sidebar').css('min-height', heights.window - heights.topbar - heights.header - heights.footer - offset); | ||||
}; | }; | ||||
$(document).on('DOMContentLoaded', () => { | $(document).on('DOMContentLoaded', () => { | ||||
// set state to collapsed on smaller devices | |||||
if ($(window).width() < 992) { | |||||
collapseSidebar = true; | |||||
anlambert: You should move this after line 6. Indeed, we backup the state of the sidebar in the… | |||||
Done Inline ActionsBut if the device is sm or xs we don't restore state from local storage. (Sidebar is always collapsed when you open any page irrespective of previous state) kalpitk: But if the device is sm or xs we don't restore state from local storage. (Sidebar is always… | |||||
Not Done Inline ActionsIndeed, you are right. So this can be landed as is. anlambert: Indeed, you are right. So this can be landed as is. | |||||
} | |||||
// restore previous sidebar state (collapsed/expanded) | // restore previous sidebar state (collapsed/expanded) | ||||
if (collapseSidebar) { | if (collapseSidebar) { | ||||
// hack to avoid animated transition for collapsing sidebar | // hack to avoid animated transition for collapsing sidebar | ||||
// when loading a page | // when loading a page | ||||
let sidebarTransition = $('.main-sidebar, .main-sidebar:before').css('transition'); | let sidebarTransition = $('.main-sidebar, .main-sidebar:before').css('transition'); | ||||
let sidebarEltsTransition = $('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition'); | let sidebarEltsTransition = $('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition'); | ||||
$('.main-sidebar, .main-sidebar:before').css('transition', 'none'); | $('.main-sidebar, .main-sidebar:before').css('transition', 'none'); | ||||
$('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition', 'none'); | $('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition', 'none'); | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |
You should move this after line 6. Indeed, we backup the state of the sidebar in the localStorage to restore it when visiting the Software Heritage archive website again. Otherwise, I am OK with this fix.