Commit a64ad713e6ca00a6f52fc15b747464079c31a734

Authored by Сергей П
1 parent e814e46c72
Exists in master

Изменения для анкеты работника

Showing 2 changed files with 24 additions and 1 deletions Side-by-side Diff

public/css/style_may2024.css
... ... @@ -8141,6 +8141,10 @@ main + .news {
8141 8141 z-index: 1;
8142 8142 position: relative;
8143 8143 }
  8144 +.cabinet__avatar-pic img{
  8145 + max-width: 100%;
  8146 + max-height: 100%;
  8147 +}
8144 8148 .cabinet__avatar-form {
8145 8149 width: calc(100% - 100px);
8146 8150 padding-left: 15px;
resources/views/workers/cabinet.blade.php
... ... @@ -2,7 +2,26 @@
2 2  
3 3 @section('scripts')
4 4 <script>
5   - console.log('Test system');
  5 + $(function() {
  6 + $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) {
  7 + const file = event.target.files[0];
  8 +
  9 + if (file) {
  10 + var img_wrap = $('.cabinet__avatar-pic');
  11 + var img = img_wrap.find('img');
  12 + const reader = new FileReader();
  13 +
  14 + reader.onload = function(e) {
  15 + img.attr('src', e.target.result);
  16 + img_wrap.find('svg').remove();
  17 + img_wrap.append(img);
  18 + };
  19 +
  20 + reader.readAsDataURL(file);
  21 + }
  22 + });
  23 + });
  24 +
6 25 $(document).on('click', '#button_new_doc123', function() {
7 26 var this_ = $(this);
8 27 var val_ = this_.attr('data-val');