summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2021-01-25 10:53:10 +0000
committerqsm-odoo <qsm@odoo.com>2021-01-25 10:53:10 +0000
commit4da6df09a4df195ad7c0caa7de7fbc7389339958 (patch)
treec87015360c24c6441a113ae4063fb0bb12d439d4
parentd63614035c84d0c0ab564102c65541d1b2b08277 (diff)
[FIX] web_editor: restore website header once page content is removed
The affixed header was not reappearing if page content was removed and the page thus indirectly scrolled. task-2446020 closes odoo/odoo#64990 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js5
1 files changed, 5 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 6e4affc028b..f38b38767ad 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -348,6 +348,11 @@ var SnippetEditor = Widget.extend({
this.destroy();
$parent.trigger('content_changed');
+ // TODO Page content changed, some elements may need to be adapted
+ // according to it. While waiting for a better way to handle that this
+ // window trigger will handle most cases.
+ $(window).trigger('resize');
+
function isEmptyAndRemovable($el, editor) {
editor = editor || $el.data('snippet-editor');
return $el.children().length === 0 && $el.text().trim() === ''