Skip to content

Commit

Permalink
add cropper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorarnau committed Apr 8, 2020
1 parent f21e8e9 commit 8c7be1e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/admin/views/attributes/I.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
<div class="modal-footer">
<a href="" class="btn clr-secondary" id="btnRotate_L_{{$attribute_name}}"><span class="btn-text"><i class="fa fa-undo" aria-hidden="true"></i></span></a>
<a href="" class="btn clr-secondary" id="btnRotate_R_{{$attribute_name}}"><span class="btn-text"><i class="fa fa-repeat" aria-hidden="true"></i></span></a>
<a href="" class="btn clr-secondary" id="btnInvertX_{{$attribute_name}}"><span class="btn-text"><i class="fa fa-arrows-h" aria-hidden="true"></i></span></a>
<a href="" class="btn clr-secondary" id="btnReset_{{$attribute_name}}"><span class="btn-text"><i class="fa fa-refresh" aria-hidden="true"></i></span></a>
<a href="" class="btn clr-danger" data-dismiss="modal"><span class="btn-text">{{getMessage('close')}}</span></a>
<a href="" class="btn clr-secondary" id="btnCrop_{{$attribute_name}}"><span class="btn-text">{{getMessage('save')}}</span></a>
</div>
Expand Down Expand Up @@ -275,6 +277,22 @@ function destroyCrop() {
});
/**
* Invert horizontal image.
*/
$('#btnInvertX_{{$attribute_name}}').on('click', function (e) {
e.preventDefault();
$cropper_{{$attribute_name}}.scaleX(-1);
});
/**
* Reset crop image.
*/
$('#btnReset_{{$attribute_name}}').on('click', function (e) {
e.preventDefault();
$cropper_{{$attribute_name}}.reset();
});
/**
* Crop image and push to dropzone.
*/
Expand Down

0 comments on commit 8c7be1e

Please sign in to comment.