summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-12 13:06:48 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-12 13:06:48 +0100
commit99d0e1b80e5b2d5eb59b96c6ce1bf246f8df2326 (patch)
tree6c53282f8a22e9b59d83762ebe057173172c5f63 /addons/website/static/src
parent4d53266e236d1816e45b13aa50bcafb1bab2bc8c (diff)
parenta403155dec769418ede3c9128a887847f97a956f (diff)
[MERGE] forward port branch 12.0 up to a403155dec7
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/content/snippets.animation.js8
-rw-r--r--addons/website/static/src/scss/bootstrap_overridden.scss13
-rw-r--r--addons/website/static/src/scss/website.ui.scss6
3 files changed, 22 insertions, 5 deletions
diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js
index 2833e5b5318..a0b25c75b01 100644
--- a/addons/website/static/src/js/content/snippets.animation.js
+++ b/addons/website/static/src/js/content/snippets.animation.js
@@ -435,6 +435,7 @@ registry.slider = Animation.extend({
*/
start: function () {
if (!this.editableMode) {
+ this.$('img').on('load.slider', this._onImageLoaded.bind(this));
this._computeHeights();
}
this.$target.carousel();
@@ -445,6 +446,7 @@ registry.slider = Animation.extend({
*/
destroy: function () {
this._super.apply(this, arguments);
+ this.$('img').off('.slider');
this.$target.carousel('pause');
this.$target.removeData('bs.carousel');
_.each(this.$('.carousel-item'), function (el) {
@@ -487,6 +489,12 @@ registry.slider = Animation.extend({
_onEditionSlide: function () {
this._computeHeights();
},
+ /**
+ * @private
+ */
+ _onImageLoaded: function () {
+ this._computeHeights();
+ },
});
registry.parallax = Animation.extend({
diff --git a/addons/website/static/src/scss/bootstrap_overridden.scss b/addons/website/static/src/scss/bootstrap_overridden.scss
index 3f9b3de7ae7..4dc818b7eea 100644
--- a/addons/website/static/src/scss/bootstrap_overridden.scss
+++ b/addons/website/static/src/scss/bootstrap_overridden.scss
@@ -2,10 +2,15 @@
// Color system
//
-// TODO should take into account the final values of yiq-text-light and
-// yiq-text-dark, not consider it is white and black, but this is ok as a
-// first approximation.
-$-is-light: if(color('text') != null, (luma(color('text')) > 50%), null);
+// Bootstrap default for $yiq-text-light and $yiq-text-dark are $white and
+// $gray-900. What we want to do is use the user text color as light or dark
+// depending on its contrast. Themes should be careful if they decide to
+// override those values. This would be simplified by giving the user the choice
+// for its dark *and* light text colors.
+$-light: if($white != null, $white, #FFFFFF);
+$-dark: if($gray-900 != null, $gray-900, #212529);
+$-text: if(color('text') != null, color('text'), $-dark);
+$-is-light: (o-get-most-contrast($-text, $-light, $-dark, color('body'), $cross-mix: false) == $-dark);
$yiq-text-light: if($-is-light, color('text'), null);
$yiq-text-dark: if($-is-light, null, color('text'));
diff --git a/addons/website/static/src/scss/website.ui.scss b/addons/website/static/src/scss/website.ui.scss
index c4a6f704f7b..1d1c42203b4 100644
--- a/addons/website/static/src/scss/website.ui.scss
+++ b/addons/website/static/src/scss/website.ui.scss
@@ -4,8 +4,12 @@
///
// LAYOUTING
-body.o_connected_user {
+body {
+ // Set frontend direction that will be flipped with
+ // rtlcss for right-to-left text direction.
direction: ltr;
+}
+body.o_connected_user {
padding-top: $o-navbar-height!important;
}