summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-11-03 12:17:04 +0000
committerqsm-odoo <qsm@odoo.com>2020-11-03 12:28:53 +0000
commit5488916657f9cd4041abdcbe3fc615174df6cb49 (patch)
tree030913e53ec07b4865af058f4da587fd5b7836ac /addons/website/static/src
parent7aac3f24b4959dde9aba2cae5df3d65f781fc8e2 (diff)
[FIX] website: fix footer/header item move
Using the handle to move elements from footer/header anywhere in the page would make the main element disappear with endless content loading animation. The end of the drag and drop executes a serie of methods : _destroyEditors > cleanForSave > toggleTargetVisibility Since the "cleaning for save" is called for all snippets and the footer doesn't contain a 'o_snippet_invisible' class, the "onTargetShow" method is called... but actually hide the footer because the "onTargetShow" implementation was so that it clicks on the visibility checkboxes regardless of its current status. Part of https://github.com/odoo/odoo/pull/59624 task-2312878
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/editor/snippets.options.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js
index d44bf8b74f8..4a0173e1127 100644
--- a/addons/website/static/src/js/editor/snippets.options.js
+++ b/addons/website/static/src/js/editor/snippets.options.js
@@ -1766,6 +1766,13 @@ const VisibilityPageOptionUpdate = options.Class.extend({
* @override
*/
async onTargetShow() {
+ if (await this._isShown()) {
+ // onTargetShow may be called even if the element is already shown.
+ // In most cases, this is not a problem but here it is as the code
+ // that follows clicks on the visibility checkbox regardless of its
+ // status. This avoids searching for that checkbox entirely.
+ return;
+ }
// TODO improve: here we make a hack so that if we make the invisible
// header appear for edition, its actual visibility for the page is
// toggled (otherwise it would be about editing an element which