From 4da6df09a4df195ad7c0caa7de7fbc7389339958 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 25 Jan 2021 10:53:10 +0000 Subject: [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) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web_editor/static/src') 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() === '' -- cgit v1.2.3