From 80f174f57b6784e1829eadf09ef61b9b71f3bd8e Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Tue, 2 Aug 2022 09:43:34 +0000 Subject: [PATCH] [FIX] website: fix url picker editor dropdown This commit fixes 2 issues with the position of the dropdown with the suggested links in the url picker input of the snippet options. (e.g. redirect url input of the countdown snippet) and the one for the input of the link editor. 1- Before this commit the dropdown went over the input while editing the url. 2- Before this commit the position of the dropdown (when above the input) was a little too low if there were images in the dropdown. It was because the images are loaded after the positioning of the dropdown and no height was defined for these images. task-2900529 closes odoo/odoo#101815 X-original-commit: 774a42ff18651a20b09a5e34222665216b19c8ec Signed-off-by: Quentin Smetz (qsm) --- addons/website/controllers/main.py | 2 +- addons/website/static/src/js/editor/snippets.options.js | 2 +- addons/website/static/src/js/editor/widget_link.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index d878b5bfc0d..fee5216974a 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -339,7 +339,7 @@ class Website(Home): for name, url, mod in current_website.get_suggested_controllers(): if needle.lower() in name.lower() or needle.lower() in url.lower(): module_sudo = mod and request.env.ref('base.module_%s' % mod, False).sudo() - icon = mod and " " % (module_sudo and module_sudo.icon or mod) or '' + icon = mod and " " % (module_sudo and module_sudo.icon or mod) or '' suggested_controllers.append({ 'value': url, 'label': '%s%s (%s)' % (icon, url, name), diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 4993ad5e084..bfcafc27a93 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -64,7 +64,7 @@ const UrlPickerUserValueWidget = InputUserValueWidget.extend({ this.inputEl.classList.add('text-start'); const options = { position: { - collision: 'flip fit', + collision: 'flip flipfit', }, classes: { "ui-autocomplete": 'o_website_ui_autocomplete' diff --git a/addons/website/static/src/js/editor/widget_link.js b/addons/website/static/src/js/editor/widget_link.js index fa846c0a962..3cb9667ea10 100644 --- a/addons/website/static/src/js/editor/widget_link.js +++ b/addons/website/static/src/js/editor/widget_link.js @@ -30,7 +30,7 @@ weWidgets.LinkTools.include({ var def = await this._super.apply(this, arguments); const options = { position: { - collision: 'flip fit', + collision: 'flip flipfit', }, classes: { "ui-autocomplete": 'o_website_ui_autocomplete'