removing click event for nav items that don't have children
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 11 Oct 2018 16:22:18 +0000 (12:22 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 11 Oct 2018 16:22:18 +0000 (12:22 -0400)
js/app.js
js/custom/pageSetup.js

index c526397..d7e2f71 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -38,4 +38,18 @@ $(document).ready(function () {
         }
     }
     $(window).on("scroll", scrolled);
+
+    var main_nav_top_level = $('.top-bar-section').children('ul').children('li.menu-item-has-children');
+  
+    main_nav_top_level.each(function() {
+        $(this).on("click",  function(event){
+            var parentId = $(this).attr("id");
+            var childId = $(event.target).parent().attr("id")
+            console.log(parentId, childId);
+            if( parentId === childId ){
+                event.preventDefault();
+            }
+        });
+        
+    });
 });
index 97ef294..0cc8819 100644 (file)
@@ -29,4 +29,18 @@ $(document).ready(function () {
         }
     }
     $(window).on("scroll", scrolled);
+
+    var main_nav_top_level = $('.top-bar-section').children('ul').children('li.menu-item-has-children');
+  
+    main_nav_top_level.each(function() {
+        $(this).on("click",  function(event){
+            var parentId = $(this).attr("id");
+            var childId = $(event.target).parent().attr("id")
+            console.log(parentId, childId);
+            if( parentId === childId ){
+                event.preventDefault();
+            }
+        });
+        
+    });
 });