function _bindEvents() {
    var inputs = _optionsDom.querySelectorAll( 'input' );

    bindEvent( _searchDom, {
      input: function() {
        _evaluate( this.value );
      },
      focus: function() {
        expand();
      },
      blur: function() {
        if ( !_isBlurSkipped &&
              _fieldsetDom.getAttribute( 'aria-hidden' ) === 'false' ) {
          collapse();
        }
      },
      mousedown: function() {
        if ( _fieldsetDom.getAttribute( 'aria-hidden' ) === 'true' ) {
          expand();
        }
      },
      keydown: function( event ) {
        var key = event.keyCode;

        if ( _fieldsetDom.getAttribute( 'aria-hidden' ) === 'true' &&
             key !== KEY_TAB ) {
          expand();
        }

        if ( key === KEY_RETURN ) {
          event.preventDefault();
          _highlight( DIR_NEXT );
        } else if ( key === KEY_ESCAPE ) {
          _resetSearch();
          collapse();
        } else if ( key === KEY_DOWN ) {
          _highlight( DIR_NEXT );
        } else if ( key === KEY_TAB &&
                    !event.shiftKey &&
                    _fieldsetDom.getAttribute( 'aria-hidden' ) === 'false' ) {
          collapse();
        }
      }
    } );

    bindEvent( _optionsDom, {
      mousedown: function() {
        _isBlurSkipped = true;
      },
      keydown: function( event ) {
        var key = event.keyCode;
        var checked = event.target.checked;

        if ( key === KEY_RETURN ) {
          event.preventDefault();
          event.target.checked = !checked;

          queryOne( event.target ).dispatchEvent( 'change' );
        } else if ( key === KEY_ESCAPE ) {
          _searchDom.focus();
          collapse();
        } else if ( key === KEY_UP ) {
          _highlight( DIR_PREV );
        } else if ( key === KEY_DOWN ) {
          _highlight( DIR_NEXT );
        }
      }
    } );

    bindEvent( _fieldsetDom, {
      mousedown: function() {
        _isBlurSkipped = true;
      }
    } );

    for ( var i = 0, len = inputs.length; i < len; i++ ) {
      bindEvent( inputs[i], {
        change: _changeHandler
      } );
    }
  }
/**
   * Binds events to the search input, option list, and checkboxes.
   */
Binds events to the search input, option list, and checkboxes.
Binds events to the search input option list and checkboxes .
function _bindEvents() {
    var inputs = _optionsDom.querySelectorAll( 'input' );
    bindEvent( _searchDom, {
      input: function() {
        _evaluate( this.value );
      },
      focus: function() {
        expand();
      },
      blur: function() {
        if ( !_isBlurSkipped &&
              _fieldsetDom.getAttribute( 'aria-hidden' ) === 'false' ) {
          collapse();
        }
      },
      mousedown: function() {
        if ( _fieldsetDom.getAttribute( 'aria-hidden' ) === 'true' ) {
          expand();
        }
      },
      keydown: function( event ) {
        var key = event.keyCode;
        if ( _fieldsetDom.getAttribute( 'aria-hidden' ) === 'true' &&
             key !== KEY_TAB ) {
          expand();
        }
        if ( key === KEY_RETURN ) {
          event.preventDefault();
          _highlight( DIR_NEXT );
        } else if ( key === KEY_ESCAPE ) {
          _resetSearch();
          collapse();
        } else if ( key === KEY_DOWN ) {
          _highlight( DIR_NEXT );
        } else if ( key === KEY_TAB &&
                    !event.shiftKey &&
                    _fieldsetDom.getAttribute( 'aria-hidden' ) === 'false' ) {
          collapse();
        }
      }
    } );
    bindEvent( _optionsDom, {
      mousedown: function() {
        _isBlurSkipped = true;
      },
      keydown: function( event ) {
        var key = event.keyCode;
        var checked = event.target.checked;
        if ( key === KEY_RETURN ) {
          event.preventDefault();
          event.target.checked = !checked;
          queryOne( event.target ).dispatchEvent( 'change' );
        } else if ( key === KEY_ESCAPE ) {
          _searchDom.focus();
          collapse();
        } else if ( key === KEY_UP ) {
          _highlight( DIR_PREV );
        } else if ( key === KEY_DOWN ) {
          _highlight( DIR_NEXT );
        }
      }
    } );
    bindEvent( _fieldsetDom, {
      mousedown: function() {
        _isBlurSkipped = true;
      }
    } );
    for ( var i = 0, len = inputs.length; i < len; i++ ) {
      bindEvent( inputs[i], {
        change: _changeHandler
      } );
    }
  }
function _bindEvents ( ) { var inputs = _optionsDom . querySelectorAll ( 'input' ) ; bindEvent ( _searchDom , { input : function ( ) { _evaluate ( this . value ) ; } , focus : function ( ) { expand ( ) ; } , blur : function ( ) { if ( ! _isBlurSkipped && _fieldsetDom . getAttribute ( 'aria-hidden' ) === 'false' ) { collapse ( ) ; } } , mousedown : function ( ) { if ( _fieldsetDom . getAttribute ( 'aria-hidden' ) === 'true' ) { expand ( ) ; } } , keydown : function ( event ) { var key = event . keyCode ; if ( _fieldsetDom . getAttribute ( 'aria-hidden' ) === 'true' && key !== KEY_TAB ) { expand ( ) ; } if ( key === KEY_RETURN ) { event . preventDefault ( ) ; _highlight ( DIR_NEXT ) ; } else if ( key === KEY_ESCAPE ) { _resetSearch ( ) ; collapse ( ) ; } else if ( key === KEY_DOWN ) { _highlight ( DIR_NEXT ) ; } else if ( key === KEY_TAB && ! event . shiftKey && _fieldsetDom . getAttribute ( 'aria-hidden' ) === 'false' ) { collapse ( ) ; } } } ) ; bindEvent ( _optionsDom , { mousedown : function ( ) { _isBlurSkipped = true ; } , keydown : function ( event ) { var key = event . keyCode ; var checked = event . target . checked ; if ( key === KEY_RETURN ) { event . preventDefault ( ) ; event . target . checked = ! checked ; queryOne ( event . target ) . dispatchEvent ( 'change' ) ; } else if ( key === KEY_ESCAPE ) { _searchDom . focus ( ) ; collapse ( ) ; } else if ( key === KEY_UP ) { _highlight ( DIR_PREV ) ; } else if ( key === KEY_DOWN ) { _highlight ( DIR_NEXT ) ; } } } ) ; bindEvent ( _fieldsetDom , { mousedown : function ( ) { _isBlurSkipped = true ; } } ) ; for ( var i = 0 , len = inputs . length ; i < len ; i ++ ) { bindEvent ( inputs [ i ] , { change : _changeHandler } ) ; } }
Binds events to the search input, option list, and checkboxes.
Binds events to the search input option list and checkboxes .