From b58b9b82ee84150aa267e57366b381177f85b22c Mon Sep 17 00:00:00 2001 From: deasydoesit <37127765+deasydoesit@users.noreply.github.com> Date: Wed, 20 Jun 2018 18:42:49 -0400 Subject: [PATCH] Updating navbar.html to include jQuery toggle Minimal changes which introduce a jQuery toggle implementation of the 'navbar-burger' and 'navbar-menu' --- docs/documentation/components/navbar.html | 28 +++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/documentation/components/navbar.html b/docs/documentation/components/navbar.html index b82097e3..6b4e5b3c 100644 --- a/docs/documentation/components/navbar.html +++ b/docs/documentation/components/navbar.html @@ -513,7 +513,7 @@ document.addEventListener('DOMContentLoaded', function () { var target = $el.dataset.target; var $target = document.getElementById(target); - // Toggle the class on both the "navbar-burger" and the "navbar-menu" + // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" $el.classList.toggle('is-active'); $target.classList.toggle('is-active'); @@ -524,6 +524,20 @@ document.addEventListener('DOMContentLoaded', function () { }); {% endcapture %} +{% capture navbar_jquery_code %} +$(document).ready(function() { + + // Check for click events on the navbar burger icon + $(".navbar-burger").click(function() { + + // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" + $(".navbar-burger").toggleClass("is-active"); + $(".navbar-menu").toggleClass("is-active"); + + }); +}); +{% endcapture %} + {% capture navbar_color_markup %}