diff options
| author | Benjamin Vray <bvr@odoo.com> | 2020-10-16 10:26:52 +0000 |
|---|---|---|
| committer | Benjamin Vray <bvr@odoo.com> | 2020-10-20 09:53:51 +0000 |
| commit | 978cd02406495e7566cefb556276e2ac2292e3f8 (patch) | |
| tree | 5d18c98b44bf43241e3ae5cc2d4c79f8645a67ce /addons/web_editor/static/src | |
| parent | a6012f03ff02f04a3d128e33326f932fd22f0ced (diff) | |
[FIX] web_editor: disable overlay pointer events on wheel event
This commit disable the pointer events on the overlay during the mouse
wheel event. To prevent page scrolling from stopping when hovering
over the overlay.
task-2312878
closes odoo/odoo#60160
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 25d16386ff9..ed38b832a6e 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -28,6 +28,7 @@ var SnippetEditor = Widget.extend({ xmlDependencies: ['/web_editor/static/src/xml/snippets.xml'], events: { 'click .oe_snippet_remove': '_onRemoveClick', + 'wheel': '_onMouseWheel', }, custom_events: { 'option_update': '_onOptionUpdate', @@ -805,6 +806,21 @@ var SnippetEditor = Widget.extend({ } } }, + /** + * Called when the 'mouse wheel' is used when hovering over the overlay. + * Disable the pointer events to prevent page scrolling from stopping. + * + * @private + * @param {Event} ev + */ + _onMouseWheel: function (ev) { + ev.stopPropagation(); + this.$el.css('pointer-events', 'none'); + clearTimeout(this.wheelTimeout); + this.wheelTimeout = setTimeout(() => { + this.$el.css('pointer-events', ''); + }, 250); + }, }); /** |
