disabling topbar links that have submenus
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 17 Oct 2016 15:17:53 +0000 (11:17 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 17 Oct 2016 15:17:53 +0000 (11:17 -0400)
js/app.js
js/custom/pageSetup.js

index db6e893..6405432 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -19,9 +19,22 @@ $(document).ready(function () {
     });
   
     // cache page
-    var page = $("body");
-    var events_icons = page.find( $("#glm-event-pdf-submit").parent() );
+    var page                    = $("body");
+  
+    var events_icons            = page.find( $("#glm-event-pdf-submit").parent() );
+    var topbar_menu_items       = page.find(".top-bar").find(".has-dropdown");
+    
     events_icons.css({
        'padding-left': 0 
     });
+    
+    // disable the links for top nav items that have subpages
+    topbar_menu_items.each( function () {
+        if ( $(this).hasClass("menu-item-has-children") ){
+            $(this).children("a").on('click', function(e){
+                e.preventDefault();
+            });
+            $(this).children('a').css("cursor", "default");
+        }
+    });
 });
index f27dc63..296beda 100644 (file)
@@ -10,9 +10,22 @@ $(document).ready(function () {
     });
   
     // cache page
-    var page = $("body");
-    var events_icons = page.find( $("#glm-event-pdf-submit").parent() );
+    var page                    = $("body");
+  
+    var events_icons            = page.find( $("#glm-event-pdf-submit").parent() );
+    var topbar_menu_items       = page.find(".top-bar").find(".has-dropdown");
+    
     events_icons.css({
        'padding-left': 0 
     });
+    
+    // disable the links for top nav items that have subpages
+    topbar_menu_items.each( function () {
+        if ( $(this).hasClass("menu-item-has-children") ){
+            $(this).children("a").on('click', function(e){
+                e.preventDefault();
+            });
+            $(this).children('a').css("cursor", "default");
+        }
+    });
 });