summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-09-17 08:19:41 +0000
committerqsm-odoo <qsm@odoo.com>2020-12-28 17:19:56 +0000
commitdf339cd0d65913548646abe6ca8182f06554333c (patch)
tree5ac1c9bd398ebd83ab00c23e9c4dccfdf549b766 /addons/web_editor/static
parent26abfd452dac2a778e4e2ba4c1c26a0896e82565 (diff)
[FIX] web_editor: show currently active aspect ratio in crop widget
When changing the crop widget from being inside of a modal window to using an inline crop widget, the functionality to show the currently active aspect ratio was lost. This commit restores that behaviour. Linked to https://github.com/odoo/odoo/issues/57604 closes odoo/odoo#57915 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Kishan Gajjar <kishanegajjar@gmail.com>
Diffstat (limited to 'addons/web_editor/static')
-rw-r--r--addons/web_editor/static/src/scss/wysiwyg.scss4
-rw-r--r--addons/web_editor/static/src/xml/wysiwyg.xml4
2 files changed, 6 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/scss/wysiwyg.scss b/addons/web_editor/static/src/scss/wysiwyg.scss
index f22d151d945..3c2a36058a8 100644
--- a/addons/web_editor/static/src/scss/wysiwyg.scss
+++ b/addons/web_editor/static/src/scss/wysiwyg.scss
@@ -474,6 +474,10 @@ img::selection {
label {
display: flex;
align-items: center;
+
+ &.active {
+ background-color: $o-we-bg-darkest;
+ }
}
button:not(.btn), label {
diff --git a/addons/web_editor/static/src/xml/wysiwyg.xml b/addons/web_editor/static/src/xml/wysiwyg.xml
index 7beb2db03c8..cef24aec75e 100644
--- a/addons/web_editor/static/src/xml/wysiwyg.xml
+++ b/addons/web_editor/static/src/xml/wysiwyg.xml
@@ -547,8 +547,8 @@
<div class="o_we_crop_buttons text-center mt16 position-absolute o_we_no_overlay" contenteditable="false">
<div class="btn-group btn-group-toggle" title="Aspect Ratio" data-toggle="buttons">
<t t-foreach="widget.aspectRatios" t-as="ratio">
- <t t-set="is_active" t-value="ratio.value === widget.aspectRatio"/>
- <label t-attf-class="{is_active and 'active' or ''}" data-action="ratio" t-att-data-value="ratio">
+ <t t-set="is_active" t-value="ratio === widget.aspectRatio"/>
+ <label t-attf-class="btn #{is_active and 'active' or ''}" data-action="ratio" t-att-data-value="ratio">
<input type="radio" /><t t-esc="ratio_value.label"/>
</label>
</t>