<!-- locationFinder javascript on settings page -->

<script>
{literal}

$(document).ready(function(){
    var field_position = $('select[name="post_config[locationFinder_position][value]"]');
    var field_type = $('input[name="post_config[locationFinder_type][value]"]');
    var field_group = $('select[name="post_config[locationFinder_group][value]"]');

    var locationFinder_check = function(){
        var val = field_position.val();

        if (val == 'in_group') {
            field_type.closest('tr').show();
            field_group.closest('tr').show();
        } else {
            field_type.closest('tr').hide();
            field_group.closest('tr').hide();
        }
    }

    locationFinder_check();
    field_position.change(function(){
        locationFinder_check();
    });
});

{/literal}
</script>

<!-- locationFinder javascript on settings page end -->