Skip to content

Commit

Permalink
[FIX] website: fix url picker editor dropdown
Browse files Browse the repository at this point in the history
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).

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#97305

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
  • Loading branch information
bvr-odoo committed Sep 29, 2022
1 parent 2a14992 commit 5edc915
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/website/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def get_suggested_link(self, needle, limit=10):
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 "<img src='%s' width='24px' class='mr-2 rounded' /> " % (module_sudo and module_sudo.icon or mod) or ''
icon = mod and "<img src='%s' width='24px' height='24px' class='mr-2 rounded' /> " % (module_sudo and module_sudo.icon or mod) or ''
suggested_controllers.append({
'value': url,
'label': '%s%s (%s)' % (icon, url, name),
Expand Down
4 changes: 2 additions & 2 deletions addons/website/static/src/js/editor/snippets.options.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ const UrlPickerUserValueWidget = InputUserValueWidget.extend({
this.inputEl.classList.add('text-left');
const options = {
position: {
collision: 'flip fit',
collision: 'flip flipfit',
},
classes: {
"ui-autocomplete": 'o_website_ui_autocomplete'
},
}
};
wUtils.autocompleteWithPages(this, $(this.inputEl), options);
},

Expand Down

0 comments on commit 5edc915

Please sign in to comment.