From 6adb7a3846d0e68ad6b02dc5a00951ee6514b22d Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 26 Apr 2018 11:18:48 -0400 Subject: [PATCH] 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 --- js/app.js | 10 ++++++++++ js/custom/pageSetup.js | 10 ++++++++++ 2 files changed, 20 insertions(+) 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; + }) + } + + }) } }); -- 2.17.1