From: Laury GvR Date: Wed, 6 Nov 2019 00:23:52 +0000 (-0500) Subject: Only disable top-level nav items if they possess no children. X-Git-Tag: v1.0.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=f22328cbef5d4864c3741aaaad9e9b0a9238f936;p=WP-Themes%2Ffinewinejourneys.git Only disable top-level nav items if they possess no children. --- diff --git a/header.php b/header.php index eb0deb2..505518a 100644 --- a/header.php +++ b/header.php @@ -5,7 +5,7 @@ <?php wp_title(); ?> - + diff --git a/js/app.js b/js/app.js index 728ccfa..10f8828 100644 --- a/js/app.js +++ b/js/app.js @@ -12,7 +12,9 @@ $(document).foundation(); $(document).ready(function () { var main_nav_top_items = $('.top-bar-section > ul').children("li"); main_nav_top_items.each(function() { - $(this).children("a").attr("href", "#"); + if ($(this).hasClass('menu-item-has-children')) { + $(this).children("a").attr("href", "#"); + } }); $('ul.children').each(function () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index bdf5c03..dea262b 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -3,7 +3,9 @@ $(document).foundation(); $(document).ready(function () { var main_nav_top_items = $('.top-bar-section > ul').children("li"); main_nav_top_items.each(function() { - $(this).children("a").attr("href", "#"); + if ($(this).hasClass('menu-item-has-children')) { + $(this).children("a").attr("href", "#"); + } }); $('ul.children').each(function () { diff --git a/style.css b/style.css index 966e019..dbf59fd 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: FineWineJourneys Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for FineWineJourneys -Version: 1.0.1.0 +Version: 1.0.2.0 */