From 3920bb6fcfb3d6245e9918dfb5cbfcb9c5748acb Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Thu, 26 Mar 2020 11:42:12 +0000 Subject: [PATCH] [FIX] web_editor: restore m2o widget in edit mode Hide the button used to display the input and show the input directly. Add a search icon into the input. Deactivate the browser autocomplete. Improve and fix the layout. Keep the field selected after choosing a result from the list. This commit was only about making it work in the 13.0 left panel. It will be improved further in master with our new left panel. task-2187712 closes odoo/odoo#50024 X-original-commit: 6660ee960a3c643ae92448d7bdc37f6c780605b6 Signed-off-by: Quentin Smetz (qsm) --- .../static/src/js/editor/snippets.options.js | 4 +--- .../web_editor/static/src/scss/wysiwyg_snippets.scss | 10 ---------- addons/web_editor/static/src/xml/snippets.xml | 11 ++++++----- 3 files changed, 7 insertions(+), 18 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 71504e2a959..2bb4dfc429d 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -3093,9 +3093,7 @@ registry.many2one = SnippetOptionWidget.extend({ self.$target.html($li.data('name')); } - _.defer(function () { - self.trigger_up('deactivate_snippet'); - }); + this._clear(); } }); diff --git a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss index 0892b3925b4..48d2d014cd0 100644 --- a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss +++ b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss @@ -999,16 +999,6 @@ body.editor_enable.editor_has_snippets { } } } - - .contact_menu { - display: block; - top: -24px; - margin: 0px; - padding: 2px 0px; - position: relative; - min-height: 44px; - position: absolute !important; - } } .s-resize-important * { diff --git a/addons/web_editor/static/src/xml/snippets.xml b/addons/web_editor/static/src/xml/snippets.xml index 2497ba83352..1e962589c4e 100644 --- a/addons/web_editor/static/src/xml/snippets.xml +++ b/addons/web_editor/static/src/xml/snippets.xml @@ -51,19 +51,20 @@ -
- -
-
  • ( )
  • +
  • ( )