From 3dc0ffa1ec68271a89dbff84e26b57273acd7518 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 1 Nov 2018 10:23:29 -0400 Subject: [PATCH] moving the oc script code out of js so it can be tested without gulp --- js/custom/pageSetup.js | 11 +---------- parts/dropdown-map.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index c1a1b7e..b6f6648 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -51,14 +51,5 @@ $(document).ready(function () { }); }); - var main_nav_top_level_oc = $('.left-off-canvas-list').children('ul').children('li.menu-item-has-children'); - main_nav_top_level_oc.each(function() { - $(this).on("click", function(event){ - let isParent = $(event.target).parent().hasClass("oc_parent"); - if( isParent ){ - event.stopPropagation(); - event.preventDefault(); - } - }); - }); + }); diff --git a/parts/dropdown-map.php b/parts/dropdown-map.php index f7729ea..d66e265 100644 --- a/parts/dropdown-map.php +++ b/parts/dropdown-map.php @@ -138,5 +138,16 @@ // region_content.text(regions['regions']['content']); // region_link.attr("href", url); }); + + var main_nav_top_level_oc = $('.left-off-canvas-list').children('ul').children('li.menu-item-has-children'); + main_nav_top_level_oc.each(function() { + $(this).on("click", function(event){ + let isParent = $(event.target).parent().hasClass("oc_parent"); + if( isParent ){ + event.stopPropagation(); + event.preventDefault(); + } + }); + }); }); -- 2.17.1