From 2d934aee71a7bfb6cf40272e1b38be240c00bc4b Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 20 Dec 2018 15:54:48 +0000 Subject: [PATCH] [IMP] website: allow customize option to be conditionally visible Before this commit, in the theme customize modal, only lists were able to be visible under the condition of a subset of options being enabled. Now options can too. PR https://github.com/odoo/odoo/pull/29624 task-1904244 --- addons/website/static/src/js/widgets/theme.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/website/static/src/js/widgets/theme.js b/addons/website/static/src/js/widgets/theme.js index 5bbb65cee75..e118366d009 100644 --- a/addons/website/static/src/js/widgets/theme.js +++ b/addons/website/static/src/js/widgets/theme.js @@ -252,15 +252,17 @@ var ThemeCustomizeDialog = Dialog.extend({ $option.find('label').append($widget); } + var $final; if ($container.hasClass('form-row')) { - $col = $('
', { + $final = $('
', { class: _.str.sprintf('col-%s', $item.data('col') || 6), }); - $col.append($option); - $container.append($col); + $final.append($option); } else { - $container.append($option); + $final = $option; } + $final.attr('data-depends', $item.data('depends')); + $container.append($final); break; case 'LIST':