Commit fa0eff9148fe471c1b994368b851e10b0ff50283
Exists in
master
Merge branch 'master' of http://gitlab.nologostudio.ru/alarionov/rekamore-su
Showing 2 changed files Side-by-side Diff
public/css/style_may2024.css
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'); |