Made navigation items clickable if they have no children, like on Capstone, rather...
authorLaury GvR <laury@gaslightmedia.com>
Wed, 29 Mar 2017 17:11:24 +0000 (13:11 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 29 Mar 2017 17:11:24 +0000 (13:11 -0400)
js/app.js
js/custom/pageSetup.js

index 881257b..8f05218 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -33,20 +33,33 @@ $(document).ready(function () {
     var page      = $('body'),
         dropdown  = page.find( $('ul#menu-top-main')),
         nav_links = page.find( $(dropdown).children('li').children('a') );
-    nav_links.each(function(){
-        $(this).on('click', function(e){
-            e.preventDefault();
-            return false;
-        });
-    });
-    nav_links.each(function(){
-        $(this).hover(
-            function(){
-                $(this).css('cursor', 'default');
-            },function(){
 
-            }
-        ); 
+    
+    var topbar_menu_items       = page.find( $(dropdown).children('li') );
+    var offcanvas_menu_items    = page.find(".left-off-canvas-list > ul").children('li');
+    
+        // disable the links for top nav items that have subpages
+    topbar_menu_items.each( function () {
+        if ( $(this).hasClass("menu-item-has-children") ){
+            $(this).css('cursor','default');
+            $(this).children("a").each ( function() {
+                $(this).css('cursor', 'default');
+            });
+            $(this).children("a").on('click', function(e){
+                e.preventDefault();
+                
+            });
+        }
+    });
+    
+    // disable the links for off canvas nav items that have subpages
+    offcanvas_menu_items.each( function () {
+        if ( $(this).hasClass("menu-item-has-children") ){
+            $(this).css('cursor','default');
+            $(this).children("a").on('click', function(e){
+                e.preventDefault();
+            });
+        }
     });
     
     var event_feed = $("#feed");
index 19a1e4b..e64fe54 100644 (file)
@@ -24,20 +24,33 @@ $(document).ready(function () {
     var page      = $('body'),
         dropdown  = page.find( $('ul#menu-top-main')),
         nav_links = page.find( $(dropdown).children('li').children('a') );
-    nav_links.each(function(){
-        $(this).on('click', function(e){
-            e.preventDefault();
-            return false;
-        });
-    });
-    nav_links.each(function(){
-        $(this).hover(
-            function(){
-                $(this).css('cursor', 'default');
-            },function(){
 
-            }
-        ); 
+    
+    var topbar_menu_items       = page.find( $(dropdown).children('li') );
+    var offcanvas_menu_items    = page.find(".left-off-canvas-list > ul").children('li');
+    
+        // disable the links for top nav items that have subpages
+    topbar_menu_items.each( function () {
+        if ( $(this).hasClass("menu-item-has-children") ){
+            $(this).css('cursor','default');
+            $(this).children("a").each ( function() {
+                $(this).css('cursor', 'default');
+            });
+            $(this).children("a").on('click', function(e){
+                e.preventDefault();
+                
+            });
+        }
+    });
+    
+    // disable the links for off canvas nav items that have subpages
+    offcanvas_menu_items.each( function () {
+        if ( $(this).hasClass("menu-item-has-children") ){
+            $(this).css('cursor','default');
+            $(this).children("a").on('click', function(e){
+                e.preventDefault();
+            });
+        }
     });
     
     var event_feed = $("#feed");