making topbar menu items not clickable if they have children
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 17 Dec 2018 19:07:55 +0000 (14:07 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 17 Dec 2018 19:07:55 +0000 (14:07 -0500)
js/app.js
js/custom/pageSetup.js

index 3c73e49..2b3ab42 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -130,7 +130,18 @@ $(document).ready(function () {
         $("#searchIcon").css("visibility", "visible");
     });
 
-  
+    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")
+            if( parentId === childId ){
+                event.stopPropagation();
+                event.preventDefault();
+            }
+        });
+    });
 });;jQuery(function($){
    
         if($(document).scrollTop() > 0){
index cb82c24..34fb917 100644 (file)
@@ -18,5 +18,16 @@ $(document).ready(function () {
         $("#searchIcon").css("visibility", "visible");
     });
 
-  
+    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")
+            if( parentId === childId ){
+                event.stopPropagation();
+                event.preventDefault();
+            }
+        });
+    });
 });
\ No newline at end of file