summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2021-02-19 14:10:58 +0000
committerNicolas Lempereur <nle@odoo.com>2021-02-19 14:13:58 +0000
commit2c0aa825ee54ed674ff9f43722031df8e2f35ca6 (patch)
treee63ffbcef3dfa5bc08f62314ad498ac8cdf6f16d
parent49a57dd5b34b66733564b31ed861fe9bfcbda2b3 (diff)
[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) <nle@odoo.com>
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js2
1 files changed, 1 insertions, 1 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 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);
}
},