Skip to content

Commit

Permalink
Merge pull request #902 from Danny-Guzman/dev
Browse files Browse the repository at this point in the history
Fixed issue with menus not working when on v5
  • Loading branch information
Danny-Guzman authored Jul 17, 2024
2 parents 2e0e44f + feb47b8 commit 328728e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build/caweb-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7868,10 +7868,10 @@ jQuery( document ).ready( function($) {
$('#ca_default_navigation_menu option[value="flexmega"]').addClass('d-none');
$('#ca_default_navigation_menu option[value="megadropdown"]').addClass('d-none');

// if current menu is no longer supported, set to singlelevel.
// if current menu is no longer supported, set to dropdown.
if( ['flexmega','megadropdown'].includes( current_menu ) ){
$(`#ca_default_navigation_menu option[value="${current_menu}"]`).attr('selected', false);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', true);
$(`#ca_default_navigation_menu option[value="dropdown"]`).attr('selected', true);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', false);
}

// Drop support for Menu Home Link.
Expand Down
6 changes: 3 additions & 3 deletions build/caweb-customizer-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ jQuery( document ).ready( function($) {
$('#ca_default_navigation_menu option[value="flexmega"]').addClass('d-none');
$('#ca_default_navigation_menu option[value="megadropdown"]').addClass('d-none');

// if current menu is no longer supported, set to singlelevel.
// if current menu is no longer supported, set to dropdown.
if( ['flexmega','megadropdown'].includes( current_menu ) ){
$(`#ca_default_navigation_menu option[value="${current_menu}"]`).attr('selected', false);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', true);
$(`#ca_default_navigation_menu option[value="dropdown"]`).attr('selected', true);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', false);
}

// Drop support for Menu Home Link.
Expand Down
2 changes: 2 additions & 0 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ function caweb_template_colors() {
function caweb_nav_menu_types() {
$menu_types = array(
'dropdown' => 'Drop Down',
'flexmega' => 'Flex Mega Menu',
'megadropdown' => 'Mega Drop',
'singlelevel' => 'Single Level',
);

Expand Down
2 changes: 1 addition & 1 deletion inc/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Theme Option filters.
add_filter( 'option_ca_site_color_scheme', 'caweb_ca_site_color_scheme', 10, 2 );
add_filter( 'option_ca_fav_ico', 'caweb_pre_option_ca_fav_ico', 10, 2 );
add_filter( 'option_ca_default_navigation_menu', 'caweb_pre_ca_default_navigation_menu', 10, 2 );
//add_filter( 'option_ca_default_navigation_menu', 'caweb_pre_ca_default_navigation_menu', 10, 2 );

/**
* This filter is used to switch menu order.
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/admin/toggle-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jQuery( document ).ready( function($) {
$('#ca_default_navigation_menu option[value="flexmega"]').addClass('d-none');
$('#ca_default_navigation_menu option[value="megadropdown"]').addClass('d-none');

// if current menu is no longer supported, set to singlelevel.
// if current menu is no longer supported, set to dropdown.
if( ['flexmega','megadropdown'].includes( current_menu ) ){
$(`#ca_default_navigation_menu option[value="${current_menu}"]`).attr('selected', false);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', true);
$(`#ca_default_navigation_menu option[value="dropdown"]`).attr('selected', true);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', false);
}

// Drop support for Menu Home Link.
Expand Down

0 comments on commit 328728e

Please sign in to comment.