From 255888586813d702c5c169f35d6daec960e0e64a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 3 Nov 2017 22:13:10 +0000 Subject: [PATCH] Open dropdown on hover, navigate on click --- static/src/js/index.js | 6 +++++- static/src/scss/style.scss | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/static/src/js/index.js b/static/src/js/index.js index a72d3cb..03cda40 100644 --- a/static/src/js/index.js +++ b/static/src/js/index.js @@ -39,7 +39,7 @@ $(document).ready(function () { }); }); -$('.navbar-brand').bind('click', function (event) { +$('.navbar-brand').on('click', function (event) { if ($('html').scrollTop() > 100) { $('html, body').stop().animate({ scrollTop: 0 @@ -49,3 +49,7 @@ $('.navbar-brand').bind('click', function (event) { } event.preventDefault(); }); + +$('.nav-item.dropdown').on('click', function () { + window.location = $(this).find('a').attr('href'); +}); diff --git a/static/src/scss/style.scss b/static/src/scss/style.scss index 134d9d1..0df69fb 100644 --- a/static/src/scss/style.scss +++ b/static/src/scss/style.scss @@ -169,3 +169,7 @@ pre.chroma { background-color: #272822; } } + +.dropdown:hover > .dropdown-menu { + display: block; +}