src/searchbar.js
function (searchbar) {
        var that = this;
        var button = searchbar.querySelector('button[type=submit]');
        var search = searchbar.querySelector('input[type=search]');

        if (typeof button === 'undefined') {
            return searchbar;
        }

        button.onclick = function (ev) {
            ev.preventDefault();
            that.emitter.emit('search-request', search);
        };

        return searchbar;
    }
function (searchbar) {
        var that = this;
        var button = searchbar.querySelector('button[type=submit]');
        var search = searchbar.querySelector('input[type=search]');

        if (typeof button === 'undefined') {
            return searchbar;
        }

        button.onclick = function (ev) {
            ev.preventDefault();
            that.emitter.emit('search-request', search);
        };

        return searchbar;
    }
function ( searchbar ) { var that = this ; var button = searchbar . querySelector ( 'button[type=submit]' ) ; var search = searchbar . querySelector ( 'input[type=search]' ) ; if ( typeof button === 'undefined' ) { return searchbar ; } button . onclick = function ( ev ) { ev . preventDefault ( ) ; that . emitter . emit ( 'search-request' , search ) ; } ; return searchbar ; }
Applies onclick events to this searchbar.

@param searchbar
@returns {*}
Applies onclick events to this searchbar .