-
- Downloads
[FIX] web_editor, website: restore control over image gallery height
This commit restores the possibility to control the height of the
image gallery snippet. This was indeed possible in <= 11.0 for all
snippets but it was removed in 12.0 as controlling the height via inner
paddings seemed enough and better (as responsive). For the image gallery
snippet however, this was a big regression as the height is forced to
70% of the current screen height on drop and the images inside are
displayed depending on that forced height. Trying to control via
paddings was not leading to the wanted effect.
This restores the possibility in 14.0 as 12.0 and 13.0 are now
deprecated. This is following a customer issue where not having the
ability to control the height is actually confusing as the user edits
its website across different screens and the height is forced to 70%
height of the screen used at the time of edition. With an height input
in the panel, the confusion is gone.
Note: this also introduces a `forceStyle` parameter for the
`selectStyle` option to be able to force the inline style a widget
controls. Indeed, without it, the system is "smart" and tries not to
force inline style when it is not needed (if you try to force red on
something that is naturally red (thanks to a CSS rule for example), it
won't be forced). Here, this was leading to an issue when trying to set
the height:
- Current height is 700px
- There is some code that forces a min-height on all carousel items so
that they are the same height. As the gallery image dimensions depend
on the block forced height (this is how the snippet work), the forced
min-height are related to that forced height (something like 680px).
- You focus the height input and type 800px
- The same code forces new min-height on all carousel item (something
like 780px).
- You un-focus the height input, the system tries to re-set 800px (which
is already set)... it ends up removing it as it thinks that setting
that height is not needed as the snippet is now "naturally" 800px tall
thanks to the carousel items' min-heights.
opw-2838774
closes odoo/odoo#103694
Signed-off-by:
Romain Derie (rde) <rde@odoo.com>
Showing
- addons/web_editor/static/src/js/editor/snippets.options.js 12 additions, 2 deletionsaddons/web_editor/static/src/js/editor/snippets.options.js
- addons/website/i18n/website.pot 14 additions, 0 deletionsaddons/website/i18n/website.pot
- addons/website/static/src/js/editor/snippets.options.js 52 additions, 0 deletionsaddons/website/static/src/js/editor/snippets.options.js
- addons/website/views/snippets/snippets.xml 1 addition, 0 deletionsaddons/website/views/snippets/snippets.xml
Loading
Please register or sign in to comment