From 1e37f106c364a13fa7785dec227bbd24903310b3 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 28 Jan 2016 10:10:13 -0500 Subject: [PATCH] added off canvas menu for toplinks topbar --- css/app.css | 6 +++++- js/app.js | 2 ++ js/custom/pageSetup.js | 2 ++ lib/navigation.php | 21 ++++++++++++++++++++- parts/off-canvas-menu.php | 3 +++ scss/_topbar.scss | 5 ++++- 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/css/app.css b/css/app.css index 40927ef..855e3e1 100644 --- a/css/app.css +++ b/css/app.css @@ -6621,9 +6621,13 @@ header { #headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown { margin-left: 5px; } -#headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown > li > a { +#headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown { width: 55%; } +#headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown > li > a { + width: 55%; + text-align: center; } + .top-bar-section li:not(.has-form) a:not(.button) { background: none; } diff --git a/js/app.js b/js/app.js index 03c81f3..f57d3fe 100644 --- a/js/app.js +++ b/js/app.js @@ -217,5 +217,7 @@ var extraDay, end, arrival, currentDate, currentDate2, requiredDate, requiredDat $($topMenu).each(function () { $(this).removeClass("active") ; }); + + $("#menu-menu-4").children("li").children("a.toggle").attr("href", "javascript:void(0)"); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 9598402..d09d402 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -208,5 +208,7 @@ var extraDay, end, arrival, currentDate, currentDate2, requiredDate, requiredDat $($topMenu).each(function () { $(this).removeClass("active") ; }); + + $("#menu-menu-4").children("li").children("a.toggle").attr("href", "javascript:void(0)"); }); diff --git a/lib/navigation.php b/lib/navigation.php index 5ef3452..2308037 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -51,7 +51,26 @@ if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) { echo ''; } } - +if ( ! function_exists( 'glm_topLinks_mobile_off_canvas' ) ) { + function glm_topLinks_mobile_off_canvas() { + echo '
'; + 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' => 'header-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() + )); + echo '
'; + } +} /** * Footer */ diff --git a/parts/off-canvas-menu.php b/parts/off-canvas-menu.php index 68230b1..7bf355f 100644 --- a/parts/off-canvas-menu.php +++ b/parts/off-canvas-menu.php @@ -10,11 +10,14 @@
  • + + diff --git a/scss/_topbar.scss b/scss/_topbar.scss index 46dc6c0..d21aecf 100644 --- a/scss/_topbar.scss +++ b/scss/_topbar.scss @@ -245,9 +245,12 @@ #headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown{ margin-left: 5px; } - +#headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown{ + width: 55%; +} #headerLinks > ul#menu-top-menu > li.menu-item > ul.dropdown > li > a{ width: 55%; + text-align: center; } .top-bar-section li:not(.has-form) a:not(.button){ -- 2.17.1