From 6209b129377735a67e5ada990ca2261175a17e74 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 22 Jun 2018 12:13:08 +0200 Subject: [PATCH] [FIX] web_editor: do 'reset' crop feature when changing ratio This reverts commit bf64efb5a0684bd61f3c2d520253721fe98c27c4. Indeed, it was in fact necessary as more complex bugs of the library can appear if we do not reset before. They even do that themself in their library demo: https://fengyuanchen.github.io/cropperjs/ --- addons/web_editor/static/src/js/widgets/widgets.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 829d37ca31d..d7662951999 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -1739,6 +1739,7 @@ var CropImageDialog = Dialog.extend({ case 'ratio': $option.siblings().removeClass('active'); $option.addClass('active'); + this.$cropperImage.cropper('reset'); this.imageData.aspectRatio = $option.data('label'); this.$cropperImage.cropper('setAspectRatio', value); break;