BuddyBoss Home – Web Support Forums Themes BuddyBoss theme The theme ads by default a div wrapper to select elements

Viewing 2 posts - 1 through 2 (of 2 total)
  • Question

    #56578
    @karlos

    Hello,

    The theme ads by default a div wrapper to select elements:

    div.buddyboss-select
    div.buddyboss-select-inner
    and also ads ads
    <span style=”display: inline”>

    I think it looks great! But I just don't need this for what I need to accomplish.

    How can I prevent the theme from adding those wrappers? The website is oigente.com and if you visit it from a phone or resize the browser you will see.

    Thank you!

    Answers

    #56968
    @vapvarun

    Hi @karlos

    it is added inside
    buddyboss/js/buddyboss.js initialed as init_select()
    you can modify and overide inside the child theme

    
    function init_select() {
    				var current = 0;
    
    				$selects = $('#page select:not([multiple]):not(#activity-privacy):not(.bp-ap-selectbox)');
    
    				$selects.each( function() {
    					var $select = $(this),
    				    $wrap, id, $span, $label, dynamic = false;
    
    					if ( this.style.display === 'none' ) {
    						return;
    					}
    
                        $wrap = $('<div class="buddyboss-select"></div>');
                        
                        if($(this).hasClass('large')) {
                            $wrap = $('<div class="buddyboss-select large"></div>');
                        }
                        
    					id      = this.getAttribute('id') || 'buddyboss-select-' + current;
    					$span  = $select.prev('span');
    
    					$select.wrap( $wrap );
                        
                        $inner_wrap = $('<div class="buddyboss-select-inner"></div>');
                        
                        $select.wrap( $inner_wrap );
                        
    					if ( ! $span.length ) {
    						$span  = $('<span></span>').hide();
    						dynamic = true;
    					}
                        
                        $span.insertBefore( $select );
    
    					// Set data on select element to use later
    					$select.data( 'buddyboss-select-info', {
    						state:     'init',
    						dynamic:   dynamic,
    						$wrap:     $wrap,
    						$label:    $span,
    						orig_text: $span.text()
    					} );
    
    					// On select change, repopulate label
    					$select.on( 'change', function( e ) {
    						populate_select_label();
    					});
    				});
    
    			}
    
    

    You can remove it
    Regards

Viewing 2 posts - 1 through 2 (of 2 total)
  • The question ‘The theme ads by default a div wrapper to select elements’ is closed to new replies.