Commit 27b7eff52558e5a8d9db5c5f2fe12bc0f0a2ade8
1 parent
7b5c12d6
Exists in
master
and in
2 other branches
Modified news crop to render with proper width and height
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
amadeus/static/js/crop_news.js
@@ -14,14 +14,16 @@ $(function () { | @@ -14,14 +14,16 @@ $(function () { | ||
14 | 14 | ||
15 | /* Scripts da caixa de corte da imagem */ | 15 | /* Scripts da caixa de corte da imagem */ |
16 | var $image = $("#image"); | 16 | var $image = $("#image"); |
17 | - var cropBoxData; | 17 | + var cropBoxData = {"width":700,"height":200}; |
18 | var canvasData; | 18 | var canvasData; |
19 | $("#modalCrop").on("shown.bs.modal", function () { | 19 | $("#modalCrop").on("shown.bs.modal", function () { |
20 | $image.cropper({ | 20 | $image.cropper({ |
21 | - viewMode: 1, | ||
22 | - aspectRatio: 1/1, | 21 | + cropBoxResizable: false, |
22 | + viewMode: 1 , | ||
23 | + aspectRatio: 4/3, | ||
23 | minCropBoxWidth: 700, | 24 | minCropBoxWidth: 700, |
24 | minCropBoxHeight: 200, | 25 | minCropBoxHeight: 200, |
26 | + dragMode: 'move', | ||
25 | ready: function () { | 27 | ready: function () { |
26 | $image.cropper("setCanvasData", canvasData); | 28 | $image.cropper("setCanvasData", canvasData); |
27 | $image.cropper("setCropBoxData", cropBoxData); | 29 | $image.cropper("setCropBoxData", cropBoxData); |