From 57605c7424bbea34761b032f4042ea59842aa73c Mon Sep 17 00:00:00 2001 From: Evert Date: Thu, 4 Jan 2018 16:16:48 +0200 Subject: [PATCH] Toggle navigation --- src/script/main.js | 8 ++++++++ src/style/main.styl | 7 +++++-- views/layout.pug | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/script/main.js b/src/script/main.js index 5cf8937..65b4160 100644 --- a/src/script/main.js +++ b/src/script/main.js @@ -120,6 +120,14 @@ $(document).ready(function () { }) } + $('body').click(function (e) { + $('#show-menu').prop('checked', false) + }) + + $('.menu').click(function (e) { + e.stopPropagation() + }) + $('#dialog #close').click(function (e) { window.Dialog.close() }) diff --git a/src/style/main.styl b/src/style/main.styl index d8867f9..be20dca 100644 --- a/src/style/main.styl +++ b/src/style/main.styl @@ -98,8 +98,11 @@ a cursor: pointer color: green - .menu:hover > .list - max-height: 500px + input[type=checkbox] + display: none + + &:checked ~ .list + max-height: 500px section font-family: "Open Sans" diff --git a/views/layout.pug b/views/layout.pug index 74f5e02..d1be3d5 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -69,8 +69,9 @@ html .part1 Icy .part2 Network .menu - .showButton(for="show-menu") + label.showButton(for="show-menu") i.fa.fa-fw.fa-bars + input(type="checkbox" id="show-menu") .list ul li