making main parent clickable if they don't have children dropdown elements
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 26 Apr 2018 15:18:48 +0000 (11:18 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 26 Apr 2018 15:18:48 +0000 (11:18 -0400)
setting main level brand clickable to url if they don't have sub menus

js/app.js
js/custom/pageSetup.js

index 508d99d..65fe585 100644 (file)
--- 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;
+                })
+            }
+            
+        })
     }
 });
index 313e2f3..454198e 100644 (file)
@@ -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;
+                })
+            }
+            
+        })
     }
 });