From 2c0aa825ee54ed674ff9f43722031df8e2f35ca6 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 19 Feb 2021 14:10:58 +0000 Subject: [FIX] web_editor: no error background position + ctrl Z Scenario: - start editing background position - press TAB key - press CTRL + Z => traceback Why: Restoring a snapshot with CTRL Z can send a click event with target not wrapped in a jQuery object which was not expected by the code. reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417 opw-2423445 closes odoo/odoo#66540 Signed-off-by: Nicolas Lempereur (nle) --- addons/web_editor/static/src/js/editor/snippets.options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src') 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 9b3baae8f8e..cbf8ffb7b6b 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -4455,7 +4455,7 @@ registry.BackgroundPosition = SnippetOptionWidget.extend({ * @private */ _onDocumentClicked: function (ev) { - if (!ev.target.closest('.o_we_background_position_overlay')) { + if (!$(ev.target).closest('.o_we_background_position_overlay')) { this._toggleBgOverlay(false); } }, -- cgit v1.2.3