mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Merge pull request #5182 from G-Chubinidze/gc_SCI_8128
Update sidebar interactions [SCI-8128]
This commit is contained in:
commit
172068dbf7
1 changed files with 17 additions and 0 deletions
|
@ -3,7 +3,18 @@ var SideBarToggle = (function() {
|
|||
var WRAPPER = '#wrapper'
|
||||
var SIDEBAR_CONTAINER = ".sidebar-container"
|
||||
|
||||
if (!$("#sidebar-wrapper").length) {
|
||||
var layout = document.querySelector(".sci--layout");
|
||||
layout.setAttribute("data-navigator-collapsed", true);
|
||||
}
|
||||
|
||||
function show() {
|
||||
var layout = document.querySelector(".sci--layout");
|
||||
if ($("#sidebar-wrapper").length) {
|
||||
layout.setAttribute("data-navigator-collapsed", false);
|
||||
} else {
|
||||
layout.setAttribute("data-navigator-collapsed", true);
|
||||
}
|
||||
$(SIDEBAR_CONTAINER).removeClass('collapsed');
|
||||
$(WRAPPER).css('paddingLeft', 'var(--wrapper-width)');
|
||||
$('.navbar-secondary').removeClass("navbar-without-sidebar");
|
||||
|
@ -15,6 +26,12 @@ var SideBarToggle = (function() {
|
|||
}
|
||||
|
||||
function hide() {
|
||||
var layout = document.querySelector(".sci--layout");
|
||||
if ($("#sidebar-wrapper").length) {
|
||||
layout.setAttribute("data-navigator-collapsed", true);
|
||||
} else {
|
||||
layout.setAttribute("data-navigator-collapsed", false);
|
||||
}
|
||||
$(SIDEBAR_CONTAINER).addClass('collapsed');
|
||||
$(WRAPPER).css('paddingLeft', '0');
|
||||
$('.navbar-secondary').addClass("navbar-without-sidebar");
|
||||
|
|
Loading…
Reference in a new issue