From: Anthony Talarico Date: Wed, 7 Dec 2016 19:38:54 +0000 (-0500) Subject: deactivating the products sidebar from being clickable, adding share this icon, makin... X-Git-Tag: v1.0.1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b80e211a9486b95d43b262b8956a4e697530e095;p=WP-Themes%2Foriginalbutterflyhouse.git deactivating the products sidebar from being clickable, adding share this icon, making off canvas nav items unclickable if they have children --- diff --git a/assets/share-icon.png b/assets/share-icon.png new file mode 100644 index 0000000..6df905d Binary files /dev/null and b/assets/share-icon.png differ diff --git a/js/app.js b/js/app.js index df7584a..0b1b05d 100644 --- a/js/app.js +++ b/js/app.js @@ -34,7 +34,19 @@ $(document).ready(function () { var page = $('body'), phone = page.find( $('.tel-phone') ), dropdown = page.find( $('ul#menu-topbar')), - nav_links = page.find( $(dropdown).children('li').children('a') ); + nav_links = page.find( $(dropdown).children('li').children('a') ), + products_sidebar = page.find($('#main-sidebar')); + products_sidebar.find('ul li').each(function(){ + var link = $(this).children('a'); + link.prop('href', '#'); + link.on('click', function(e){ + e.preventDefault(); + }); + link.css('cursor', 'default'); + }); + + console.log(products_sidebar); + nav_links.each(function(){ $(this).on('click', function(e){ diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index bf767c4..cd28136 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -25,7 +25,19 @@ $(document).ready(function () { var page = $('body'), phone = page.find( $('.tel-phone') ), dropdown = page.find( $('ul#menu-topbar')), - nav_links = page.find( $(dropdown).children('li').children('a') ); + nav_links = page.find( $(dropdown).children('li').children('a') ), + products_sidebar = page.find($('#main-sidebar')); + products_sidebar.find('ul li').each(function(){ + var link = $(this).children('a'); + link.prop('href', '#'); + link.on('click', function(e){ + e.preventDefault(); + }); + link.css('cursor', 'default'); + }); + + console.log(products_sidebar); + nav_links.each(function(){ $(this).on('click', function(e){ diff --git a/lib/menu-walker.php b/lib/menu-walker.php index 5d5d54e..51e4a08 100644 --- a/lib/menu-walker.php +++ b/lib/menu-walker.php @@ -65,6 +65,9 @@ class Glm_Theme_Off_Canvas_Walker extends Walker_Nav_Menu { if ( in_array( 'label', $classes ) ) { $item_html = preg_replace( '/]*>(.*)<\/a>/iU', '', $item_html ); } + if ( $depth === 0 && $object->has_children ) { + $item_html = preg_replace( '/]*>(.*)<\/a>/iU', '$1', $item_html ); + } $output .= $item_html; }