From: Anthony Talarico Date: Thu, 26 Apr 2018 15:18:48 +0000 (-0400) Subject: making main parent clickable if they don't have children dropdown elements X-Git-Tag: v1.0.9^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=6adb7a3846d0e68ad6b02dc5a00951ee6514b22d;p=WP-Themes%2Fbrewbakers.git making main parent clickable if they don't have children dropdown elements setting main level brand clickable to url if they don't have sub menus --- diff --git a/js/app.js b/js/app.js index 508d99d..65fe585 100644 --- a/js/app.js +++ b/js/app.js @@ -48,5 +48,15 @@ $(document).ready(function () { $('.glm-rv-brand').on("click", function(){ window.location = $(this).data('url'); }) + $('.manufacturer-brand').each(function(){ + let url = $(this).children('a').attr('href'); + if( $(this).children('ul').length <= 0 ){ + // $(this).attr('data-url', url); + $(this).on("click", function(){ + window.location = url; + }) + } + + }) } }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 313e2f3..454198e 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -39,5 +39,15 @@ $(document).ready(function () { $('.glm-rv-brand').on("click", function(){ window.location = $(this).data('url'); }) + $('.manufacturer-brand').each(function(){ + let url = $(this).children('a').attr('href'); + if( $(this).children('ul').length <= 0 ){ + // $(this).attr('data-url', url); + $(this).on("click", function(){ + window.location = url; + }) + } + + }) } });