From 85ae7fe56e93fcc18b3842e6c116bcb6968988e3 Mon Sep 17 00:00:00 2001 From: Oussama MESSAOUDI Date: Fri, 5 Mar 2021 12:21:48 +0000 Subject: [PATCH] [IMP] website: show scroll button option only in case of fixed height - Show "scroll down button" only when height is 100%. - Make the "scroll down button" a child of that "height" option. task-2471323 closes odoo/odoo#68825 Related: odoo/design-themes#18 Signed-off-by: Quentin Smetz (qsm) --- .../static/src/js/editor/snippets.options.js | 14 ++++++++++++++ addons/website/views/snippets/snippets.xml | 19 +++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 111437292e3..7211aadc694 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -2756,6 +2756,20 @@ options.registry.ScrollButton = options.Class.extend({ // Options //-------------------------------------------------------------------------- + /** + * @see this.selectClass for parameters + */ + async showScrollButton(previewMode, widgetValue, params) { + if (widgetValue) { + this.$button.show(); + } else { + if (previewMode) { + this.$button.hide(); + } else { + this.$button.detach(); + } + } + }, /** * Toggles the scroll down button. */ diff --git a/addons/website/views/snippets/snippets.xml b/addons/website/views/snippets/snippets.xml index 41767ef4edd..fa0b6494473 100644 --- a/addons/website/views/snippets/snippets.xml +++ b/addons/website/views/snippets/snippets.xml @@ -1004,20 +1004,19 @@ - -
- - Auto - 50% - 100% - -
-
- + + Auto + 50% + 100% + + +