Skip to content

Commit

Permalink
allow multiple submenu items
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Oct 8, 2020
1 parent 3403384 commit bf1d9df
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 22 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
?>
<header id="site-header" class="site-header <?php echo apply_filters('dt_header_extra_class', $extra_class); ?> <?php echo esc_attr( get_theme_mod('dt_header_shadow', DT_HEADER_SHADOW) ); ?>" role="banner" style="<?php echo dt_header_image(); ?>">
<nav class="navbar navbar-expand-lg navbar-dark <?php if(get_theme_mod('dt_container_full', DT_CONTAINER_FULL)){echo 'container-fluid';}else{ echo "container";}?>" style="z-index: 1025;">
<nav class="navbar navbar-expand-lg navbar-dark navbar-multi-sub-menus <?php if(get_theme_mod('dt_container_full', DT_CONTAINER_FULL)){echo 'container-fluid';}else{ echo "container";}?>" style="z-index: 1025;">
<?php
/**
* This action is called before the site logo wrapper.
Expand Down
2 changes: 1 addition & 1 deletion lib/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ds_menu_a_class( $atts, $item, $args ) {

// add menu dropdown item
if ( ! empty( $item->menu_item_parent ) ) {
$atts['class'] = ' dropdown-item'; // deliberately remove other classes for styling
$atts['class'] .= ' dropdown-item'; // deliberately remove other classes for styling
}


Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/assets/css/ayecode-ui.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/ayecode/wp-ayecode-ui/assets/css/ayecode-ui.css.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
@import "badge";
@import "background";
@import "floating_labels";
@import "positioning";
@import "positioning";
@import "nav";
2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/ayecode-ui-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
add_action('after_setup_theme', function () {
global $ayecode_ui_version,$ayecode_ui_file_key;
$this_version = "0.1.26";
$this_version = "0.1.27";
if(version_compare($this_version , $ayecode_ui_version, '>')){
$ayecode_ui_version = $this_version ;
$ayecode_ui_file_key = wp_hash( __FILE__ );
Expand Down
3 changes: 3 additions & 0 deletions vendor/ayecode/wp-ayecode-ui/change-log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 0.1.27 =
* Allow menus to have multiple submenus with by adding class .navbar-multi-sub-menus - ADDED

= 0.1.26 =
* List view image not fully taking up column - FIXED
* clear-both class added - ADDED
Expand Down
33 changes: 33 additions & 0 deletions vendor/ayecode/wp-ayecode-ui/includes/ayecode-ui-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,44 @@ function aui_init_carousel_multiple_items(){
aui_carousel_maybe_show_multiple_items(this);
});
}

/**
* Allow navs to use multiple sub menus.
*/
function init_nav_sub_menus(){
jQuery( '.navbar-multi-sub-menus .dropdown-menu a.dropdown-toggle' ).on( 'click', function ( e ) {
var $el = jQuery( this );
$el.toggleClass('active-dropdown');
var $parent = jQuery( this ).offsetParent( ".dropdown-menu" );
if ( !jQuery( this ).next().hasClass( 'show' ) ) {
jQuery( this ).parents( '.dropdown-menu' ).first().find( '.show' ).removeClass( "show" );
}
var $subMenu = jQuery( this ).next( ".dropdown-menu" );
$subMenu.toggleClass( 'show' );

jQuery( this ).parent( "li" ).toggleClass( 'show' );

jQuery( this ).parents( 'li.nav-item.dropdown.show' ).on( 'hidden.bs.dropdown', function ( e ) {
jQuery( '.dropdown-menu .show' ).removeClass( "show" );
$el.removeClass('active-dropdown');
} );

if ( !$parent.parent().hasClass( 'navbar-nav' ) ) {
$el.next().addClass('position-relative border-top border-bottom');
}

return false;
} );
}


/**
* Initiate all AUI JS.
*/
function aui_init(){
// nav menu submenus
init_nav_sub_menus();

// init tooltips
aui_init_tooltips();

Expand All @@ -702,6 +734,7 @@ function aui_init(){
jQuery(window).on("load",function() {
aui_init();
});

</script>
<?php
$output = ob_get_clean();
Expand Down
2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/includes/class-aui.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AUI {
*
* @var string $ver The current version number.
*/
public static $ver = '0.1.26';
public static $ver = '0.1.27';

public static $options = null;

Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[
{
"name": "ayecode/wp-ayecode-ui",
"version": "0.1.26",
"version_normalized": "0.1.26.0",
"version": "0.1.27",
"version_normalized": "0.1.27.0",
"source": {
"type": "git",
"url": "https://github.com/AyeCode/wp-ayecode-ui.git",
"reference": "9ae0160ad6df3d436af723ea3d21f4945b9a72bd"
"reference": "df90fcb9896946390723457513fc553432f378c7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/AyeCode/wp-ayecode-ui/zipball/9ae0160ad6df3d436af723ea3d21f4945b9a72bd",
"reference": "9ae0160ad6df3d436af723ea3d21f4945b9a72bd",
"url": "https://api.github.com/repos/AyeCode/wp-ayecode-ui/zipball/df90fcb9896946390723457513fc553432f378c7",
"reference": "df90fcb9896946390723457513fc553432f378c7",
"shasum": ""
},
"require": {
"composer/installers": "~1.0",
"php": ">=5.3.0"
},
"time": "2020-10-07T18:29:54+00:00",
"time": "2020-10-08T11:18:26+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down

0 comments on commit bf1d9df

Please sign in to comment.