diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-09-25 14:37:13 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-09-29 09:33:58 +0000 |
| commit | b1f9057af0d38176985ecfbe125ae992422b9744 (patch) | |
| tree | 169b17accfc76e0a07893bee1877ae7d1b010088 /addons/web_editor/static/src/js/editor | |
| parent | 8459c9dae1a83b7f1d827ee40991778c9bb9d9cd (diff) | |
[FIX] web_editor: make we-input full-width if unit is large
The design was made considering the units would not be bigger than 2 or
3 characters... but it is currently used with translated texts like
"products". In those cases, force the input to be full-width.
task-2312878
closes odoo/odoo#57927
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 671f973a0a9..c7b30f86dfd 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1043,6 +1043,9 @@ const InputUserValueWidget = UnitUserValueWidget.extend({ var unitEl = document.createElement('span'); unitEl.textContent = unit; this.containerEl.appendChild(unitEl); + if (unit.length > 3) { + this.el.classList.add('o_we_large_input'); + } }, //-------------------------------------------------------------------------- |
