HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers33/bbec.nl/workbench/komma/kms/src/views/attributes/password.blade.php
<div class="entity-attribute entity-attribute-password{{{ count($attribute->errors) == 0 ? '' : ' error' }}} {{{$attribute->class}}} @if( !$attribute->show || ($attribute->show === 'admin' && !\Auth::user()->get()->is_admin) ) hidden @endif photo " id="kms-password_{{$attribute->key}}" data-uk-tooltip="{pos:'bottom-right'}" title="{{{ $attribute->errors[0] or '' }}}">
    {{ Form::label($attribute->key, $attribute->label) }}

    @if(! $attribute->section->isCreatingEntity())
        <div class="password-enabler">
            <a href="#">{{Config::get('kms::'.$lang.'/translations.changePassword')}}</a>
        </div>
    @endif

    <div class="password-field">
        {{ Form::password($attribute->key, ['placeholder' => $attribute->placeholder]) }}
    </div>

    @if(! $attribute->section->isCreatingEntity())
    <script>
        $(function(){

            var $passwordEnabler = $('#kms-password_{{$attribute->key}} .password-enabler');
            var $passwordField = $('#kms-password_{{$attribute->key}} .password-field');

            // The password input field needs to be removed, so it won't be saved when it hasn't changed
            var passwordFieldInner = $('#kms-password_{{$attribute->key}} .password-field').html();
            $('#kms-password_{{$attribute->key}} .password-field').html('');

            // Show the password field
            $('#kms-password_{{$attribute->key}} .password-enabler a').click(function(){
                $('#kms-password_{{$attribute->key}} .password-enabler').css('display', 'none');
                $('#kms-password_{{$attribute->key}} .password-field').css('display', 'block');
                $('#kms-password_{{$attribute->key}} .password-field').html(passwordFieldInner);

                // Hide the password field if empty on blur
                $('#kms-password_{{$attribute->key}} .password-field input').blur(function(){
                    if(! $(this).val()){
                        $('#kms-password_{{$attribute->key}} .password-enabler').css('display', 'block');
                        $('#kms-password_{{$attribute->key}} .password-field').css('display', 'none');
                        $('#kms-password_{{$attribute->key}} .password-field').html('');
                    }
                });

                $('#kms-password_{{$attribute->key}} .password-field input').focus();
            });
        });
    </script>
    @endif

</div>