summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets/widgets.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-06-22 12:13:08 +0200
committerqsm-odoo <qsm@odoo.com>2018-06-22 17:09:54 +0200
commit6209b129377735a67e5ada990ca2261175a17e74 (patch)
tree92038ef094ba4ac2bf4a0a28d4ef517c5e40d4b1 /addons/web_editor/static/src/js/widgets/widgets.js
parent27bbcb45ad7db802f3635b489c3fe39d2f5c7893 (diff)
[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/
Diffstat (limited to 'addons/web_editor/static/src/js/widgets/widgets.js')
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js1
1 files changed, 1 insertions, 0 deletions
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;