From: Steve Sutton Date: Tue, 10 Nov 2015 20:31:15 +0000 (-0500) Subject: small update to off canvas X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=1faee4a4e39f5310d95ca3781764dbd547a084ad;p=web%2FGruntInit%2FglmTheme.git small update to off canvas --- diff --git a/root/js/custom/pageSetup.js b/root/js/custom/pageSetup.js index dde383c..7b76e81 100644 --- a/root/js/custom/pageSetup.js +++ b/root/js/custom/pageSetup.js @@ -12,8 +12,13 @@ $(document).ready(function () { var menuImg = $(this).parent('li').prop('id'); var menuNum = menuImg.match(/\d+/)[0]; var menuImgSrc = 'img_for_menu_' + menuNum; - $(this).find('li.image-placeholder').html(''); - console.log('ul = ' + menuImg); - console.log('menu-id = ' + menuNum); + if (window['img_for_menu_' + menuNum]) { + $(this).find('li.image-placeholder').html(''); + } else { + $(this).find('li.image-placeholder').parent('ul').addClass('no-image-subul'); + $(this).find('li.image-placeholder').remove(); + } + //console.log('ul = ' + menuImg); + //console.log('menu-id = ' + menuNum); }); }); diff --git a/root/lib/navigation.php b/root/lib/navigation.php index a47a8a0..0c1b74d 100644 --- a/root/lib/navigation.php +++ b/root/lib/navigation.php @@ -30,22 +30,25 @@ if ( ! function_exists( 'glm_theme_top_bar' ) ) { * Mobile off-canvas */ if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) { - function glm_theme_mobile_off_canvas() { - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'off-canvas-list', // adding custom nav class - 'theme_location' => 'top-bar', // where it's located in the theme - 'before' => '', // before each link - 'after' => '', // after each link - 'link_before' => '', // before each link text - 'link_after' => '', // after each link text - 'depth' => 5, // limit the depth of the nav - 'fallback_cb' => false, // fallback function (see below) - 'walker' => new Glm_Theme_Off_Canvas_Walker() - )); - } + function glm_theme_mobile_off_canvas() { + echo '
'; + echo '
'; + } } /**