From 4d5c99b25d71ef7e0d7a1907e1f2c98578920756 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 22 Aug 2018 14:19:54 -0400 Subject: [PATCH] adding toggle functionality to the off canvas menu item as well as the toggle --- js/app.js | 7 ++++++- js/custom/pageSetup.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index d9c7397..fc8a6f7 100644 --- a/js/app.js +++ b/js/app.js @@ -14,10 +14,15 @@ $(document).ready(function () { $('ul.children').each(function () { $(this).before(''); }); - $('a.toggle').click('click', function () { + $('a.toggle').click('click', function (e) { $(this).toggleClass('open'); $(this).siblings('ul').toggleClass('open'); }); + $('.left-off-canvas-list').find('.menu-item-has-children').on("click", function(e){ + e.preventDefault(); + $(this).children('a.toggle').toggleClass('open'); + $(this).children('ul').toggleClass('open'); + }) // Custom js and jquery for staffords /////////////////// // reservation for toggle click function /////////////// $("#res-tab a").on('click', function () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 399bdda..ee9acb2 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -5,10 +5,15 @@ $(document).ready(function () { $('ul.children').each(function () { $(this).before(''); }); - $('a.toggle').click('click', function () { + $('a.toggle').click('click', function (e) { $(this).toggleClass('open'); $(this).siblings('ul').toggleClass('open'); }); + $('.left-off-canvas-list').find('.menu-item-has-children').on("click", function(e){ + e.preventDefault(); + $(this).children('a.toggle').toggleClass('open'); + $(this).children('ul').toggleClass('open'); + }) // Custom js and jquery for staffords /////////////////// // reservation for toggle click function /////////////// $("#res-tab a").on('click', function () { -- 2.17.1