|
32 | 32 |
|
33 | 33 | <button class="btn btn-primary" onclick="performCrop()">{{ trans('laravel-filemanager::lfm.btn-crop') }}</button> |
34 | 34 | <button class="btn btn-info" onclick="loadItems()">{{ trans('laravel-filemanager::lfm.btn-cancel') }}</button> |
35 | | - <form action="{{ route('unisharp.lfm.getCrop') }}" role='form' name='cropForm' id='cropForm' mathod='post'> |
| 35 | + <form id='cropForm'> |
36 | 36 | <input type="hidden" id="img" name="img" value="{{ $img->name }}"> |
37 | 37 | <input type="hidden" id="working_dir" name="working_dir" value="{{ $working_dir }}"> |
38 | 38 | <input type="hidden" id="dataX" name="dataX"> |
@@ -80,22 +80,14 @@ function changeAspectRatio(_this, aspectRatio) { |
80 | 80 | return false; |
81 | 81 | } |
82 | 82 | function performCrop() { |
83 | | - $.ajax({ |
84 | | - type: "GET", |
85 | | - dataType: "text", |
86 | | - url: "{{ route('unisharp.lfm.getCropimage') }}", |
87 | | - data: { |
88 | | - img: '{{ parse_url($img->url, PHP_URL_PATH) }}', |
89 | | - working_dir: $("#working_dir").val(), |
90 | | - dataX: $("#dataX").val(), |
91 | | - dataY: $("#dataY").val(), |
92 | | - dataHeight: $("#dataHeight").val(), |
93 | | - dataWidth: $("#dataWidth").val(), |
94 | | - type: $('#type').val() |
95 | | - }, |
96 | | - cache: false |
97 | | - }).done(function (data) { |
98 | | - loadItems(); |
99 | | - }); |
| 83 | + performLfmRequest('cropimage', { |
| 84 | + img: $("#img").val(), |
| 85 | + working_dir: $("#working_dir").val(), |
| 86 | + dataX: $("#dataX").val(), |
| 87 | + dataY: $("#dataY").val(), |
| 88 | + dataHeight: $("#dataHeight").val(), |
| 89 | + dataWidth: $("#dataWidth").val(), |
| 90 | + type: $('#type').val() |
| 91 | + }).done(loadItems); |
100 | 92 | } |
101 | 93 | </script> |
0 commit comments