Skip to content
xmpp_domain_registration.js 1.13 KiB
Newer Older
$('document').ready(function(){
    // Not needed as long as maildomain hook is not implemented
    return;
Michael Fürmann's avatar
Michael Fürmann committed
    $('#management_method').on('select2-selecting', function(e){
        val = e.choice ? e.choice.id : e.target.selectedIndex;
Michael Fürmann's avatar
Michael Fürmann committed
        if(val == 0){
            //normal
            $('#toggle-management-normal').addClass('in');
            $('#toggle-registration-closed').addClass('in');
            $('#public_registration').trigger('change');
Michael Fürmann's avatar
Michael Fürmann committed
        }else if(val != undefined){
            //maildomain
            $('#toggle-management-normal').removeClass('in');
            $('#toggle-registration-closed').removeClass('in');
Michael Fürmann's avatar
Michael Fürmann committed
            $('#toggle-management-normal').removeClass('in');
            $('#toggle-registration-closed').removeClass('in');
        }
    });
    $('#public_registration').on('change', function(e){
        if($(this).is(':checked')){
            $('#toggle-registration-closed').removeClass('in');
        }else{
            $('#toggle-registration-closed').addClass('in');
        }
    });
    $('#public_registration').trigger('change');
Michael Fürmann's avatar
Michael Fürmann committed
    $('#management_method').trigger('select2-selecting');