submit search by clicking icon when auto_refresh is disabled

<?php
/** allows magnifying glass search icon 
 ** to trigger a submit even when auto_refresh
 ** is disabled
 **/
add_action('facetwp_scripts', function () {
    ?>
    <script>
        (function($) {
            $().on('click', '.facetwp-type-search .facetwp-icon', function() {
                if (! FWP.is_refresh) {
                    FWP.refresh();
                }
            });
        })(fUtil);
    </script>
<?php
});