diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-06-20 18:08:28 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-06-21 12:59:16 +0200 |
| commit | a473453b3166a381130d9bd6ec4851b9e1ecab26 (patch) | |
| tree | cd8e9fe6ebd2a0a0b254e0501861e2f861aae67c /addons/web_editor/static/src/xml/editor.xml | |
| parent | cd812bd6f46988959535288d657353d273fb6d61 (diff) | |
[FIX] web_editor: review crop attachment creation/discard
Previous implementation was wrong as it did not care about the ability
to discard a crop edition. Indeed, whenever a crop dialog was saved,
a crop attachment was created or updated at once. Discarding the editor
would then either:
- Seem to discard a first-time cropped image but would have created an
attachment for nothing (just the image src was reset)
OR
- Fail to discard a second-time cropped image as the cropped attachment
would have been directly updated and the image src would not have
changed
This commit changes the way it works:
- On crop dialog save, the image is marked with required data for a
potential future save of the cropped image (as a DB attachment) and
the src is set to the base64 cropped image directly.
Note that the code ends up being clearer and efficient that way too.
Diffstat (limited to 'addons/web_editor/static/src/xml/editor.xml')
| -rw-r--r-- | addons/web_editor/static/src/xml/editor.xml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml index 7240397ff56..b74919e3691 100644 --- a/addons/web_editor/static/src/xml/editor.xml +++ b/addons/web_editor/static/src/xml/editor.xml @@ -312,7 +312,7 @@ </div> <t t-else=""> <div class="o_crop_area"> - <img class="img img-responsive o_cropper_image" t-att-src="widget.imageData.src" /> + <img class="img img-responsive o_cropper_image" t-att-src="widget.imageData.originalSrc"/> </div> <div class="o_crop_options text-center mt16"> <div class="btn-group" title="Aspect Ratio" data-toggle="buttons"> |
