From a808d1b4d9e161529931def6b5d4a9334d77a1b9 Mon Sep 17 00:00:00 2001 From: pichalite Date: Fri, 3 Feb 2017 17:43:51 +0000 Subject: [PATCH] Set aspect ratio to square and confine crop box to image --- public/src/client/account/edit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/client/account/edit.js b/public/src/client/account/edit.js index 92b9a0e61e..1239bc7074 100644 --- a/public/src/client/account/edit.js +++ b/public/src/client/account/edit.js @@ -218,7 +218,10 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator', cropperModal.modal('show'); var img = document.getElementById('cropped-image'); - var cropperTool = new cropper.default(img, {}); + var cropperTool = new cropper.default(img, { + aspectRatio: 1 / 1, + viewMode: 1 + }); cropperModal.find('.crop-btn').on('click', function () { $(this).addClass('disabled');