<div class="modal-content">

    <div class="modal-header">
    <h5 class="modal-title">
        {{ $value->title }}
    </h5>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">

    @include('travel.user.booking.mail.modal-show-mail-inner', ['customer_mail' => $customer_mail, 'show_move_dirs' => true])

    {{-- @if($customer_mail->customer_fewo_mail)
        @include('travel.user.booking.mail.modal-show-mail-inner', ['customer_fewo_mail' => $customer_mail->customer_mail])
    @endif
     --}}
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
</div>

</div>

<script type="text/javascript">
    function change_mail_subdir_select(_form){

        var $dir_id = _form.find('#customer_mail_dir').val();
        $('.customer_mail_subdir').each(function () {
            var customer_mail_subdir = 'customer_mail_subdir_' + $dir_id;
            if($(this).attr('id') === customer_mail_subdir){
                $(this).prop('disabled', false);
                $(this).show();
            }else{
                $(this).prop('disabled', true);
                $(this).val(0);
                $(this).hide();
            }
        })
    }

    $(document).ready(function() {
        $('form.move-mail-form').each(function () {
            var _form = $(this);
            $(this).find('.customer_mail_dir').on('change', function () {
                change_mail_subdir_select(_form);
                _form.find('.btn-default').removeClass('btn-default').addClass('btn-primary');
            });
            $(this).find('.customer_mail_subdir').on('change', function () {
                _form.find('.btn-default').removeClass('btn-default').addClass('btn-primary');
            });
            change_mail_subdir_select(_form);
        });
    });
</script>