diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-06 15:57:57 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-06 15:57:57 +0200 |
| commit | 0fadd586fae2dcab5a61284c166794477f17d697 (patch) | |
| tree | db9c16b8ed8c73de48660d99d20a024f01b8866a /addons/website/static/src | |
| parent | 2c029a0cf64dc8b8aaf784659c53f544119c4e66 (diff) | |
| parent | ff9ddfdacc9581361b555fd5f69e2da61800acad (diff) | |
[MERGE] forward port branch 12.0 up to ff9ddfdacc9
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/js/widgets/theme.js | 28 | ||||
| -rw-r--r-- | addons/website/static/src/scss/website.scss | 4 |
2 files changed, 30 insertions, 2 deletions
diff --git a/addons/website/static/src/js/widgets/theme.js b/addons/website/static/src/js/widgets/theme.js index a5e0731e4b0..6d774b65073 100644 --- a/addons/website/static/src/js/widgets/theme.js +++ b/addons/website/static/src/js/widgets/theme.js @@ -529,6 +529,34 @@ var ThemeCustomizeDialog = Dialog.extend({ _setActive: function () { var self = this; + // First enforce that all input groups have only one element checked as + // it is supposed to be (it might not be the case on initialization, for + // exemple if we had data-xmlid="A" and data-xmlid="A,B" and if A and B + // are active, the 2 related inputs would be checked). + var $radioXMLInputs = this.$inputs.filter('[type="radio"][data-xmlid]'); + var optionNames = _.uniq(_.map($radioXMLInputs, function (option) { + return option.name; + })); + _.each(optionNames, function (optionName) { + var $inputs = $radioXMLInputs.filter('[name="' + optionName + '"]:checked'); + if ($inputs.length > 1) { + $inputs.prop('checked', false); + + var maxNbXMLIDs = -1; + var $maxInput = null; + _.each($inputs, function (input) { + var $input = $(input); + var xmlID = $input.data('xmlid'); + var nbXMLIDs = xmlID ? xmlID.split(',').length : 0; + if (nbXMLIDs >= maxNbXMLIDs) { + maxNbXMLIDs = nbXMLIDs; + $maxInput = $input; + } + }); + $maxInput.prop('checked', true); + } + }); + // Look at all options to see if they are enabled or disabled var $enable = this.$inputs.filter(':checked'); diff --git a/addons/website/static/src/scss/website.scss b/addons/website/static/src/scss/website.scss index 2aec4f03251..5373d9ec304 100644 --- a/addons/website/static/src/scss/website.scss +++ b/addons/website/static/src/scss/website.scss @@ -534,8 +534,8 @@ table.table_desc tr td { // Default &.s_carousel_default { // Controls - chevron - .carousel-control-prev-icon:before { content: "\f053"; margin-left: 1.5rem; } - .carousel-control-next-icon:before { content: "\f054"; margin-right: 1.5rem; } + .carousel-control-prev-icon:before { content: "\f053" #{"/*rtl:'\f054'*/"}; margin-left: 1.5rem; } + .carousel-control-next-icon:before { content: "\f054" #{"/*rtl:'\f053'*/"}; margin-right: 1.5rem; } .carousel-control-prev-icon:before, .carousel-control-next-icon:before { background-color: rgba(0,0,0,0); |
