From 502f45aa2d0292e2c5ba25d0cfc36ecdffc41ab5 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 25 Sep 2018 18:43:30 +0200 Subject: [PATCH] [FIX] website(_event): make parallax filter change the default color Setting a black low-transparency filter on a parallax element was leaving the text color black too as the filter did not act as a background color. Now the filter is computed from the parallax background color. --- .../static/src/js/editor/snippets.options.js | 3 ++ addons/website/static/src/scss/website.scss | 11 ++++- addons/website/views/snippets.xml | 44 +++++++++---------- addons/website_event/data/event_demo.xml | 1 - 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index e9e3ae3a8f7..0be541713a4 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -835,6 +835,9 @@ registry.background = SnippetOption.extend({ * image is removed. */ bindBackgroundEvents: function () { + if (this.$target.is('.parallax, .s_parallax_bg')) { + return; + } this.$target.off('.background-option') .on('background-color-event.background-option', (function (e, previewMode) { e.stopPropagation(); diff --git a/addons/website/static/src/scss/website.scss b/addons/website/static/src/scss/website.scss index 4322adabcad..548433bc231 100644 --- a/addons/website/static/src/scss/website.scss +++ b/addons/website/static/src/scss/website.scss @@ -822,11 +822,20 @@ table.table_desc tr td { > * { position: relative; } - > .s_parallax_bg, > .s_parallax_filter { + > .s_parallax_bg { @include o-position-absolute(0, 0, 0, 0); + display: block; + background-color: inherit; background-size: cover; background-attachment: scroll; pointer-events: none; + + &::after { + content: ""; + @include o-position-absolute(0, 0, 0, 0); + display: block; + background-color: inherit; + } } &.s_parallax_is_fixed > .s_parallax_bg { background-attachment: fixed; diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index 775c2c990ba..dd75539a600 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -14,9 +14,8 @@