diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-08-05 15:57:57 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-08-10 14:27:00 +0000 |
| commit | 2f0bf44c7a1ef2354fa6a0b87b1f380fa161305b (patch) | |
| tree | b048db0a21b934fa72f20e214e5d116aa13ef56f /addons/website/static/src/js/content/snippets.animation.js | |
| parent | f563b0c78244be48686b289a26638e4d7905e87d (diff) | |
[IMP] website: review parallax option UI
Instead of two select:
Parallax: none/fixed/very slow/slow/...
Direction: Bottom to top/top to bottom
We now have:
Parallax: none/fixed/bottom to top/top to bottom
Intensity: slider
Part of https://github.com/odoo/odoo/pull/47313
task-46147
closes odoo/odoo#47313
Related: odoo/design-themes#335
Related: odoo/upgrade#1553
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/js/content/snippets.animation.js')
| -rw-r--r-- | addons/website/static/src/js/content/snippets.animation.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 76bb7c66f24..7de8fbef029 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -553,15 +553,11 @@ registry.Parallax = Animation.extend({ this.ratio = this.speed * (this.viewport / 10); // Provide a "safe-area" to limit parallax + const absoluteRatio = Math.abs(this.ratio); this.$bg.css({ - top: -this.ratio, - bottom: -this.ratio, + top: -absoluteRatio, + bottom: -absoluteRatio, }); - - // Get parallax direction - if (this.el.dataset.scrollBackgroundDirection === 'bottom') { - this.ratio = -this.ratio; - } }, //-------------------------------------------------------------------------- |
