Skip to content

Commit 5d3e15b

Browse files
committed
Custom button for crop action
1 parent 1c3162f commit 5d3e15b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

croppic.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
rotateControls: true,
3030
modal:false,
3131
customUploadButtonId:'',
32+
customCropButtonId: '',
3233
loaderHtml:'',
3334
scaleToFill: true,
3435
processInline: false,
@@ -414,7 +415,14 @@
414415
cropControlRotateRight = '<i class="cropControlRotateRight"></i>';
415416
}
416417

417-
html = '<div class="cropControls cropControlsCrop">'+ cropControlZoomMuchIn + cropControlZoomIn + cropControlZoomOut + cropControlZoomMuchOut + cropControlRotateLeft + cropControlRotateRight + cropControlCrop + cropControlReset + '</div>';
418+
if(that.options.customCropButtonId ==='') {
419+
html = '<div class="cropControls cropControlsCrop">'+ cropControlZoomMuchIn + cropControlZoomIn + cropControlZoomOut + cropControlZoomMuchOut + cropControlRotateLeft + cropControlRotateRight + cropControlCrop + cropControlReset + '</div>';
420+
} else {
421+
html = '<div class="cropControls cropControlsCrop">'+ cropControlZoomMuchIn + cropControlZoomIn + cropControlZoomOut + cropControlZoomMuchOut + cropControlRotateLeft + cropControlRotateRight + cropControlReset + '</div>';
422+
$('#'+that.options.customCropButtonId).on('click', function(){
423+
that.crop();
424+
});
425+
}
418426

419427
that.obj.append(html);
420428

0 commit comments

Comments
 (0)