From b9a8b38844278f26b9d1d1d53256e0781ba3575a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 20 Sep 2019 10:52:14 +0200 Subject: Fix page body not being scrollable in admin layout (#11893) Hide navigation behind hamburger icon on small screens in admin layout --- app/javascript/packs/public.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/javascript/packs') diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 97ee4dfa2..ed713f335 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -247,6 +247,16 @@ function main() { input.readonly = oldReadOnly; }); + + delegate(document, '.sidebar__toggle__icon', 'click', () => { + const target = document.querySelector('.sidebar ul'); + + if (target.style.display === 'block') { + target.style.display = 'none'; + } else { + target.style.display = 'block'; + } + }); } loadPolyfills().then(main).catch(error => { -- cgit