PageSourceSearch

https://naturaldharma.org/wp-content/themes/buddyboss-theme/assets/js/vendors/menu.js?ver=2.21.0

js naturaldharma.org collected 2026-09-24 11:28:42 UTC 3,613 bytes, 85 lines download raw bytes

1( function ( $ ) {
2    $.fn.BossSocialMenu = function ( reduceWidth ) {
3        $( this ).each( function () {
4            //alignMenu( this );
5            var elem = this,
6                $elem = $( this );
7
8            window.addEventListener( 'resize', run_alignMenu );
9            window.addEventListener( 'load', run_alignMenu );
10
11            function run_alignMenu() {
12                $elem.find( 'li.bb_more_dropdown__title' ).remove();
13
14                $elem.append( $( $( $elem.children( 'li.hideshow' ) ).children( 'ul' ) ).html() );
15                $elem.children( 'li.hideshow' ).remove();
16                alignMenu( elem );
17            }
18
19            function alignMenu( obj ) {
20                var self = $( obj ),
21                    w = 0,
22                    i = -1,
23                    menuhtml = '',
24                    mw = self.width() - reduceWidth;
25
26                $.each( self.children( 'li' ).not( '.bb_more_dropdown__title' ), function () {
27                    i++;
28                    w += $( this ).outerWidth( true );
29                    if ( mw < w ) {
30                        menuhtml += $( '<div>' ).append( $( this ).clone() ).html();
31                        $( this ).remove();
32                    }
33                } );
34
35                self.append( '<li class="hideshow menu-item-has-children" data-no-dynamic-translation>' +
36                  '<a class="more-button" href="#"><i class="bb-icon-f bb-icon-ellipsis-h"></i><span class="screen-reader-text">' + bs_data.more_menu_title + '</span></a>' +
37                  '<ul class="sub-menu bb_more_dropdown" data-no-dynamic-translation>' + menuhtml + '</ul>' +
38                  '<div class="bb_more_dropdown_overlay"></div></li>' );
39
40                if ( self.find( '.hideshow .bb_more_dropdown .bb_more_dropdown__title' ).length < 1 && $( window ).width() < 981 ) {
41                    $( self ).find( '.hideshow .bb_more_dropdown' ).append( '<li class="bb_more_dropdown__title">' +
42                      '<span class="bb_more_dropdown__title__text">' + bs_data.more_menu_title + '</span>' +
43                      '<span class="bb_more_dropdown__close_button" role="button">' +
44                      '<i class="bb-icon-l bb-icon-times"></i></span></li>' );
45                }
46
47                if ( self.find( 'li.hideshow' ).find( 'li' ).not( '.bb_more_dropdown__title' ).length > 0 ) {
48                    self.find( 'li.hideshow' ).show();
49                } else {
50                    self.find( 'li.hideshow' ).hide();
51                }
52            }
53
54            //Vertical nav condition
55            function checkVerticalMenu() {
56
57                if( $( window ).width() > 738 && $elem.parent().hasClass( 'vertical' ) ) {
58
59                    if( $elem.find( 'li.hideshow' ).length ) {
60
61                        var verticalmenuhtml = '';
62
63                        $.each( $elem.find( 'li.hideshow ul' ).children(), function () {
64                            verticalmenuhtml +=  $( this ).wrap('<p/>').parent().html();
65                            $( this ).parent().remove();
66                        } );
67
68                        $elem.append( verticalmenuhtml );
69                        $elem.append( $( $( $elem.children( 'li.hideshow' ) ).children( 'ul' ) ).html() );
70                        $elem.children( 'li.hideshow' ).remove();
71
72                    } else {
73                        return;
74                    }
75
76                }
77
78            }
79
80            window.addEventListener( 'resize', checkVerticalMenu );
81            window.addEventListener( 'load', checkVerticalMenu );
82
83        } );
84    }
85}( jQuery ) );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.