src/bselect.js
function( arg ) {
            var listItems, listItem, i, len, results;
            var options = _callMethod( this, "option" );
            var searched = arg instanceof $.Event ? arg.target.value : arg;
            var bselect = _callMethod( this, "element" );

            if ( this[ 0 ].disabled ) {
                return this;
            }

            // Avoid searching for nothing
            if ( searched === "" ) {
                _callMethod( this, "clearSearch" );
            }

            if ( !( arg instanceof $.Event ) ) {
                bselect.find( ".bselect-search" ).val( searched );
            }

            // Same search/few chars? We won't search then!
            if (
                ( searched === options.lastSearch ) ||
                ( searched.length < options.minSearchInput )
            ) {
                return;
            }

            // Initialize the result collection
            results = $();

            listItems = bselect.find( "li" ).hide();
            for ( i = 0, len = listItems.length; i < len; i++ ) {
                listItem = listItems[ i ];
                if ( listItem.textContent.toLowerCase().indexOf( searched.toLowerCase() ) > -1 ) {
                    results = results.add( $( listItem ).show() );
                }
            }

            if ( results.length === 0 ) {
                showNoOptionsAvailable( this );
            } else {
                bselect.find( ".bselect-message" ).hide();
            }

            this.trigger( "bselectsearch", [ searched, results ] );

            adjustDropdownHeight( listItems.end() );
            return this;
        }
function( arg ) {
            var listItems, listItem, i, len, results;
            var options = _callMethod( this, "option" );
            var searched = arg instanceof $.Event ? arg.target.value : arg;
            var bselect = _callMethod( this, "element" );

            if ( this[ 0 ].disabled ) {
                return this;
            }

            // Avoid searching for nothing
            if ( searched === "" ) {
                _callMethod( this, "clearSearch" );
            }

            if ( !( arg instanceof $.Event ) ) {
                bselect.find( ".bselect-search" ).val( searched );
            }

            // Same search/few chars? We won't search then!
            if (
                ( searched === options.lastSearch ) ||
                ( searched.length < options.minSearchInput )
            ) {
                return;
            }

            // Initialize the result collection
            results = $();

            listItems = bselect.find( "li" ).hide();
            for ( i = 0, len = listItems.length; i < len; i++ ) {
                listItem = listItems[ i ];
                if ( listItem.textContent.toLowerCase().indexOf( searched.toLowerCase() ) > -1 ) {
                    results = results.add( $( listItem ).show() );
                }
            }

            if ( results.length === 0 ) {
                showNoOptionsAvailable( this );
            } else {
                bselect.find( ".bselect-message" ).hide();
            }

            this.trigger( "bselectsearch", [ searched, results ] );

            adjustDropdownHeight( listItems.end() );
            return this;
        }
function ( arg ) { var listItems , listItem , i , len , results ; var options = _callMethod ( this , "option" ) ; var searched = arg instanceof $ . Event ? arg . target . value : arg ; var bselect = _callMethod ( this , "element" ) ; if ( this [ 0 ] . disabled ) { return this ; } // Avoid searching for nothing
 if ( searched === "" ) { _callMethod ( this , "clearSearch" ) ; } if ( ! ( arg instanceof $ . Event ) ) { bselect . find ( ".bselect-search" ) . val ( searched ) ; } // Same search/few chars? We won't search then!
 if ( ( searched === options . lastSearch ) || ( searched . length < options . minSearchInput ) ) { return ; } // Initialize the result collection
 results = $ ( ) ; listItems = bselect . find ( "li" ) . hide ( ) ; for ( i = 0 , len = listItems . length ; i < len ; i ++ ) { listItem = listItems [ i ] ; if ( listItem . textContent . toLowerCase ( ) . indexOf ( searched . toLowerCase ( ) ) > - 1 ) { results = results . add ( $ ( listItem ) . show ( ) ) ; } } if ( results . length === 0 ) { showNoOptionsAvailable ( this ) ; } else { bselect . find ( ".bselect-message" ) . hide ( ) ; } this . trigger ( "bselectsearch" , [ searched , results ] ) ; adjustDropdownHeight ( listItems . end ( ) ) ; return this ; }
Searches every item in the list for the given text
Searches every item in the list for the given text