require(['jquery', 'cla_select2', 'domReady'], function ($, select2, domReady) {
    domReady(function () {
        $('.select2').select2({
            width: '100%'
        });

        $('#search_string_form input[name=q]').on('change', function () {
            $('#search_refine_form input[name=q]').val($(this).val());
        });
        $('#search_string_form').on('submit', function (event) {
            event.preventDefault();
            $('#search_refine_form input[name=q]').val($('#search_string_form input[name=q]').val());
            $('#search_refine_form').submit();
        });
        $('#all_projects_cb').on('change', function () {
            $('#project_select_block').toggle(!this.checked);
        }).change();
    });
});
