From 9cc0780367d5edc05ef240f90f0158deda6392bd Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 29 Apr 2018 20:30:34 +1000 Subject: [PATCH] Sidenav toggles --- InvenTree/static/script/sidenav.js | 2 +- InvenTree/templates/base.html | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/InvenTree/static/script/sidenav.js b/InvenTree/static/script/sidenav.js index 2d0761f647..1520b91ea7 100644 --- a/InvenTree/static/script/sidenav.js +++ b/InvenTree/static/script/sidenav.js @@ -5,5 +5,5 @@ function openSideNav() { function closeSideNav() { document.getElementById("sidenav").style.width = "0"; - document.getElementById("inventree-content").style.marginLeft = "0"; + document.getElementById("inventree-content").style.marginLeft = "50px"; } \ No newline at end of file diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index ad81d24aed..1ba7605ab4 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -62,7 +62,12 @@ $(document).ready(function () { "#stock-tree"); $('#logo').click(function() { - openSideNav(); + if ($("#sidenav").width() == 0) { + openSideNav(); + } + else { + closeSideNav(); + } }); {% block js_ready %}